Java Questions

Page 2 - Seeking answers? Join the AnandTech community: where nearly half-a-million members share solutions and discuss the latest tech.

JC0133

Senior member
Nov 2, 2010
201
1
76
Thanks guys I was able to fix the error from all of your input. And now I have a MUCH better understanding of when and where to declare variables.

O it was a compile error I noticed in Eclipse.

I am still fairly new to this and will try to be more clear when asking questions.
 

JC0133

Senior member
Nov 2, 2010
201
1
76
I see something strange with your for loop declaration... shouldn't it be

Code:
for (int newSuit=1; newSuit <= 4; newSuit++) {
    for (int newValue = 1; newValue <= 13; newValue++) {
...
Unless newSuit and newValue are declared as ints outside of the loop, this code wouldn't even compile.


I declared newSuit and newValue outside of the loop.
 

ioni

Senior member
Aug 3, 2009
619
11
81
If you have a crash in Java, you get a stack trace as output. The stack here refers to the method call stack.