This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Cattle Drive and the fly likes Please decode error message. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » This Site » Cattle Drive
Bookmark "Please decode error message." Watch "Please decode error message." New topic

Please decode error message.

Tim Uckun
Ranch Hand

Joined: Jan 19, 1999
Posts: 88
I don't understand this error message. What is it trying to tell me?
Attempt to reference method length in class java.lang.String as an instance variable.
here is the offending code.
int wordlength = args[0].length;

"There are some who call me TIM?"
Tim Uckun
Ranch Hand

Joined: Jan 19, 1999
Posts: 88
Never mind I found it. It wanted
args[0].length(); instead of args[0].length;
Now here is a another one.
Starting application F:\Progs\java\repeater\Repeater.class
java.lang.NoSuchMethodError: main
Exception in thread "main" Interactive Session Ended
Tim Uckun
Ranch Hand

Joined: Jan 19, 1999
Posts: 88
Never mind again. Found out that the
public void main() had to be static as in
static public void main()
Ranch Hand

Joined: Nov 22, 2008
Posts: 18944
That's cool. A thread where someone has answered all of their own questions. This would be a good start for a "Common Problems FAQ" for Java.
I've always desired a "Lessons Learned" doc of some kind wrt Java. . .
Tim Uckun
Ranch Hand

Joined: Jan 19, 1999
Posts: 88
What is really needed is a decent error message. Why can't the error messages be clear? Why can't they tell you exactly what was expected and what was delivered? That way we can try and fix the problem instead of trying to figure out what the compiler is trying to tell us.
Matt Midcap

Joined: Jan 07, 1999
Posts: 440
We're with you brother Tim!

Best Regards,<br />Matt Midcap
It is sorta covered in the JavaRanch Style Guide.
subject: Please decode error message.
Similar Threads
confirmation pop up box in struts 1.1
out of bounds exception
Strings and arrays
I need to write a code for an MP3 encoder using jav
problem with barcodes