This assignment is about card game called WAR that has 4 classes the main,Card,CardDeck,and Hand. I am struggling athand class which requiredpublic Hand()// constructor of the object that hold the playerscards.public void displayHand()// display the handpublic void take(Card c )// takes a card that is dealtpublic int value()// retuns the value of the handcould you please help me here is the code in java :import java.util.Scanner;public class main {public static void main(String[] args)��{Scanner keyboard = new Scanner(System.in);int Choice;int menu=0, WAR=1;CardDeck d = new CardDeck();System.out.println("Welcome to the War Game");d.ShowMenu();while (menu==0){Choice = keyboard.nextInt();WAR=1;d.User=0;d.Comp=0;switch (Choice) {case 1:d = new CardDeck();
System.out.println("You Have A New Card Deck!");d.ShowMenu();break;case 2:System.out.println("-----------------------------------");System.out.println("Here Are All The Cards In The Deck!");System.out.println("-----------------------------------");for (int k = 0; k<52;k++){d.displayCardAt(k);}d.ShowMenu();break;case 3:d.shuffle();System.out.println("Your Deck Has Been Shuffled!");d.ShowMenu();break;case 4:while(WAR==1){System.out.println("----------------------------------");System.out.println("Get Ready To Play Two-Card WAR!!!!");System.out.println("----------------------------------");System.out.println("There are "+d.cardsLeft()+" left in the deck.");System.out.println("...dealing...");System.out.println("-----------------------");
System.out.println("Here Are Your Two Cards");System.out.println("-----------------------");d.Deal();d.Deal();System.out.println("---------------------");System.out.println("Here Are My Two Cards");System.out.println("---------------------");d.CompDeal();d.CompDeal();System.out.println();System.out.println("Your Score is " + d.User);System.out.println();