Alright, well I am getting the ".class expected" error. I cannot figure out what it is nor is google helping much either.

public class Driver
{
    public static void main (String[] args){
        Scanner scanIn = new Scanner(System.in);
        Deck deck = new Deck();
        Card[] hand = new Card[5];
        Shuffle shuffle = new Shuffle(deck);
        Scorer scorer = new Scorer();
        
        shuffle.shuffle();
        
        for(int i = 0; i < hand.length; i++){
            hand[i] = new Card();
            hand[i] = deck.deal();
        }
        
        System.out.println(deck.printDeck());
        
        System.out.print("How many cards would you like to replace >");
        int ans = scanIn.nextInt();
        System.out.println();
        
        if (ans != 0){
            for(int i = 0; i < ans; i++){
                System.out.print("Which card would you like changed (0-4) ");
                hand[scanIn.nextInt()] = deck.deal();
            }
        }
        
        System.out.println(deck.printDeck());
        
        scorer.scoreHand(hand[]);
    }
}

I am getting the error on line 32 with "scorer.scoreHand(hand[]);"

The scoreHand method of the scorer class is expecting an array of Cards (Card[]) which is what hand[] is.

Any help is much appreciated.

Thanks,

Justin Byrd

Recommended Answers

All 4 Replies

Can u plz help me to create design for a sales managing software

Could you post the Scorer class? I can't really find anything wrong with what you've done, but maybe a look at the other class will help.

Unfortunately we weren't given the .java file, only the .class file for the Scorer class so we couldn't look into the class code. But it is past deadline anyways.

Thanks for trying :)

Hello,
You need to try more fast and strict because at this way you can face more.so You may try bellow:-
scorer.scoreHand(hand[0]);
and please check again.

<<url removed>>

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.