Eclipse is telling me:
Multiple markers at this line
- Method breakpoint:Card [entry] -
toString()
- This method must return a result of
type String
- overrides java.lang.Object.toString
I don't understand why this is producing an error because my method returns a String. What is wrong?
Code://toString method
public String toString(){
switch (card){
case 0:
return "2 of Clubs";
case 1:
return "3 of Clubs";
case 2:
return "4 of Clubs";
case 3:
return "5 of Clubs";
case 4:
return "6 of Clubs";
case 5:
return "7 of Clubs";
case 6:
return "8 of Clubs";
case 7:
return "9 of Clubs";
case 8:
return "10 of Clubs";
case 9:
return "Jack of Clubs";
case 10:
return "Queen of Clubs";
case 11:
return "King of Clubs";
case 12:
return "Ace of Clubs";
case 13:
return "2 of Spades";
case 14:
return "3 of Spades";
case 15:
return "4 of Spades";
case 16:
return "5 of Spades";
case 17:
return "6 of Spades";
case 18:
return "7 of Spades";
case 19:
return "8 of Spades";
case 20:
return "9 of Spades";
case 21:
return "10 of Spades";
case 22:
return "Jack of Spades";
case 23:
return "Queen of Spades";
case 24:
return "King of Spades";
case 25:
return "Ace of Spades";
case 26:
return "2 of Hearts";
case 27:
return "3 of Hearts";
case 28:
return "4 of Hearts";
case 29:
return "5 of Hearts";
case 30:
return "6 of Hearts";
case 31:
return "7 of Hearts";
case 32:
return "8 of Hearts";
case 33:
return "9 of Hearts";
case 34:
return "10 of Hearts";
case 35:
return "Jack of Hearts";
case 36:
return "Queen of Hearts";
case 37:
return "King of Hearts";
case 38:
return "Ace of Hearts";
case 39:
return "2 of Diamonds";
case 40:
return "3 of Diamonds";
case 41:
return "4 of Diamonds";
case 42:
return "5 of Diamonds";
case 43:
return "6 of Diamonds";
case 44:
return "7 of Diamonds";
case 45:
return "8 of Diamonds";
case 46:
return "9 of Diamonds";
case 47:
return "10 of Diamonds";
case 48:
return "Jack of Diamonds";
case 49:
return "Queen of Diamonds";
case 50:
return "King of Diamonds";
case 51:
return "Ace of Diamonds";
}
}

