Permabanned
- Joined
- 18 Nov 2011
- Posts
- 368
- Location
- Aberystwyth
Hello, at the moment, the method I'm using currently returns whats left in the array as strings rather than an int count.
so lets say I had 4 cards left in the game it would return
4 diamonds, 5 spades, ace clubs, queen diamonds.
[4d.gif, 5s.gif, ac.gif, qd.gif]
However, I need to add to the method so that it counts those elements left and returns them as an int, which in this case would be 4. That would be the score for the game.
Anyone be able to give me some sort of help on this situation please? If possible with an explanation, not just the answer, as then I won't learn anything, which is the whole purpose.
Example
public int size()
{
return graphicCard.size();
}
System.out.println("The number of elements in the array are:" +graphicCard+ "");
so lets say I had 4 cards left in the game it would return
4 diamonds, 5 spades, ace clubs, queen diamonds.
[4d.gif, 5s.gif, ac.gif, qd.gif]
However, I need to add to the method so that it counts those elements left and returns them as an int, which in this case would be 4. That would be the score for the game.
Anyone be able to give me some sort of help on this situation please? If possible with an explanation, not just the answer, as then I won't learn anything, which is the whole purpose.

Example
public int size()
{
return graphicCard.size();
}
System.out.println("The number of elements in the array are:" +graphicCard+ "");