Discussion:
Syntax Rules in Netbeans 8.0?
a***@gmail.com
2014-10-21 15:40:46 UTC
Permalink
Hi all.
I'm going back to the drawing board and taking some time to review Java. I'm working through the SAMS Teach Yourself Java in 21 Days and I've hit a bit of a snag. In the chapter that discusses arrays there is a sample with the following code:


Code:
public class HalfDollars {
int[] newYork = {1_900_000, 1_700_000, 1_700_000};
int[] newJersey = new int[newYork.length];
int[] total = new int[newYork.length];
int average;

newJersey[0] = 1_900_000;
newJersey[1] = 1_800_000;
newJersey[2] = 1_750_000;
....
}



However, the IDE generates an error on the last three lines of code with the following message:

"Cannot find symbol class: newJersey"

I'm using Netbeans 8.0; however if I try the same code in Neatbeans 7.3.1 it works without any errors. Can anyone confirm whether there is change in Netbeans that is causing this error? Thanks.
geertjan wielenga
2014-10-22 13:31:44 UTC
Permalink
For me, that code is fine in NetBeans 8. Maybe drop me an e-mail
off-thread with more details, a screenshot, etc.

Thanks,

Geertjan
Post by a***@gmail.com
Hi all.
public class HalfDollars {
int[] newYork = {1_900_000, 1_700_000, 1_700_000};
int[] newJersey = new int[newYork.length];
int[] total = new int[newYork.length];
int average;
newJersey[0] = 1_900_000;
newJersey[1] = 1_800_000;
newJersey[2] = 1_750_000;
....
}
"Cannot find symbol class: newJersey"
I'm using Netbeans 8.0; however if I try the same code in Neatbeans 7.3.1 it works without any errors. Can anyone confirm whether there is change in Netbeans that is causing this error? Thanks.
Loading...