| Author |
same errors (cannot find symbol) for two codes
|
Joey Chen
Greenhorn
Joined: May 13, 2007
Posts: 15
|
|
I am getting the same error for both these codes(both different). I been trying to figure out the problem and tried other possibilities but I just can't seem to crack it. Can someone lend me a hand and point me to the right direction. Code 1: Code 2: Btw, code 2 isn't complete yet but I just wanted to compile the code I had to see if I encountered any errors so far which obviously I am. [ September 12, 2007: Message edited by: Joey Chen ]
|
 |
Srikanth Basa
Ranch Hand
Joined: Jun 06, 2005
Posts: 241
|
|
You want to compile and run against which version ? anyway, here are a couple of fixes that you probably want to make. [ September 12, 2007: Message edited by: Srikanth Basavaraju ]
|
 |
Joey Chen
Greenhorn
Joined: May 13, 2007
Posts: 15
|
|
Ah. I see my mistakes now. Thank you, I definitely will remember these mistakes. However, if I wanted to still use isEmpty() in the first code, how could I have used it correctly without the code getting complicated. Also, is the length method in args.length from the java.lang.String? I am asking because I see a length() method in there but it has parenthesis after the length() so why wouldn't it be args.length()? [ September 12, 2007: Message edited by: Joey Chen ]
|
 |
marc weber
Sheriff
Joined: Aug 31, 2004
Posts: 11343
|
|
Originally posted by Joey Chen: ...is the length method in args.length from the java.lang.String? I am asking because I see a length() method in there but it has parenthesis after the length() so why wouldn't it be args.length()? ...
The variable "args" is an array (not a String), and "length" is a public field in an array. This is described under JLS 10.7 Arrays.
|
"We're kind of on the level of crossword puzzle writers... And no one ever goes to them and gives them an award." ~Joe Strummer
sscce.org
|
 |
 |
|
|
subject: same errors (cannot find symbol) for two codes
|
|
|