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
posted
0
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
posted
0
Never mind again. Found out that the public void main() had to be static as in static public void main()
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
posted
0
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.