File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

same errors (cannot find symbol) for two codes

 
Joey Chen
Greenhorn
Posts: 15
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 241
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 15
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 11343
Java Mac Safari
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Don't get me started about those stupid light bulbs.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic