Re: Error help?
- From: IchBin <weconsul@xxxxxxx>
- Date: Mon, 25 Sep 2006 01:37:01 -0400
Tukewl4u wrote:
Ok, I'm a little confused. I've thought that, but what does 'cannot find symbol' mean? Does something need to be specified in the object? I'm trying to modify Small Java Fig. 3.7-3.8 http://www.cs.unt.edu/~irby/Courses/1030/programs/SJch3.html to a class project and don't see the difference. To me...it should work. Now I get:
Executing: C:\Program Files\ConTEXT\ConExec.exe "C:\Program
Files\Java\jdk1.5.0_07\bin\javac.exe" "GradeBookTest.java"
GradeBookTest.java:29: cannot find symbol
symbol : variable input
location: class GradeBookTest
String name = input.nextLine(); // read a line of text
^
GradeBookTest.java:34: non-static method displayMessage() cannot be referenced from a static context
GradeBook.displayMessage();
^
2 errors
Execution finished.
"Eric Sosman" <esosman@xxxxxxxxxxxxxxxxxxx> wrote in message news:sJKdnX3eYo5ZaovYnZ2dnUVZ_qCdnZ2d@xxxxxxxxxxxxxxTukewl4u wrote:
Hello allShould be
Can some one tell me why I'm getting this error? I really don't understand
why it shouldn't work.
GradeBookTest.java:30: ')' expected
gradebook2.setCourseName ( String Name ); // set the course name
^
[...]
String Name = input.nextLine(); // read a line of text
gradebook2.setCourseName ( String Name ); // set the course name
gradebook2.setCourseName(Name); // set the course name
--
Eric Sosman
esosman@xxxxxxxxxxxxxxxxxxx
Please learn how to post to a news group. DO not 'TOP POST'... Its screws up the thread.
Need to have your code along with the errors.
The non-static error is saying you are trying to call a method that needs to be static. You are calling that method from a static method.
Let me guess: main()
--
Thanks in Advance...
IchBin, Pocono Lake, Pa, USA http://weconsultants.phpnet.us
__________________________________________________________________________
'If there is one, Knowledge is the "Fountain of Youth"'
-William E. Taylor, Regular Guy (1952-)
.
- References:
- Error help?
- From: Tukewl4u
- Re: Error help?
- From: Eric Sosman
- Re: Error help?
- From: Tukewl4u
- Error help?
- Prev by Date: Re: Help for synchronize threads
- Next by Date: A Simple jTextPane Problem
- Previous by thread: Re: Error help?
- Next by thread: A Simple jTextPane Problem
- Index(es):