How do you test the code? I don't see a main() method.
Type: Posts; User: Norm
How do you test the code? I don't see a main() method.
Please post the current version of the code that shows what problem you are having.
That sounds like you need a loop to go through the contents of the ArrayList and count the number of times each item appears in the list.
What does that have to do with coding enum usage?
Post#24 shows a way to use enums.
Rewrite the code in post#23 to use that technique and show what you are trying to do.
Add some comments to...
Where are the items that are being counted to see if there are three of a kind? Should there be three variables that the code tests the contents of to see if they match?
The enum is spelled: with A not a- Arms not arms.
Why does the code try to compare an enum to an int?
This code compiles:
if(Arms.INFANTRY == arms){
I don't have any packages for testing forum code. That's why I'd like all the code in one file for testing.
if(arm.INFANTRY == 3){
arm is an array and does not have a field named:...
That code doesn't compile. These are its errors:
Where is the code that generates those error messages?
Can you post a small, simple, complete program that shows the problem?
Something that will compile when the problem is fixed.
Sorry, I'd prefer ONE file for testing, not two or three or whatever is needed.
It shouldn't take over 20 lines of code.
Also post the full text of the compiler's error message when you try to...
Can you post a small, simple, complete program that shows the problem?
Something that will compile when the problem is fixed.
Did you try: Arms.INFANTRY
Try adding on the name of the enum.
If there are more than one card in the hand after removing 3 cards from deck, which card is it supposed to return?
public Card removeCardsFromHand(
The method says that it is going to return an instance of the Card class.
Is that what it is supposed to return?
The code is trying to return an ArrayList. The...
The ArrayList class's remove() method is defined to take one int as its argument. The code is trying to call that method with 3 int values.
Can the code be changed to call the remove() method...