| Author |
Compiler error cannot find symbol
|
Janice Twomey
Greenhorn
Joined: Mar 01, 2011
Posts: 3
|
|
Im not sure where the problem is help would be greatly appreciated
error is refering to the line public static string studentName
|
 |
Wouter Oet
Saloon Keeper
Joined: Oct 25, 2008
Posts: 2700
|
|
Hi and welcome to the Javaranch.
There is no such thing as string class there is however a String class. Classnames start with an uppercase character.
|
"Any fool can write code that a computer can understand. Good programmers write code that humans can understand." --- Martin Fowler
Please correct my English.
|
 |
Janice Twomey
Greenhorn
Joined: Mar 01, 2011
Posts: 3
|
|
|
Thanks a lack of sleep is catchin up with me
|
 |
Matthew Brown
Bartender
Joined: Apr 06, 2010
Posts: 3793
|
|
Hi Janice,
Welcome to CodeRanch!
Java is case-sensitive, and string != String.
By the way, it's this case sensitivity which makes it important to be consistent with your variable naming. The Java convention is that classes start with a capital, and methods and variables start lower case. But your Balance and Print variables start with capitals - you'd be better off fixing that while you're at it.
Edit: ah, too slow!
|
 |
Buddhika Mawella
Ranch Hand
Joined: Jan 06, 2011
Posts: 36
|
|
Hi friend,
You use a IDE like Eclipse(http://www.eclipse.org/) to test your java programs instead of typing on notepad. Then you can easily detect these type of syntax errors.
|
BM
|
 |
Janice Twomey
Greenhorn
Joined: Mar 01, 2011
Posts: 3
|
|
I've fix a good bit but I'm still getting symbol errors
|
 |
Buddhika Mawella
Ranch Hand
Joined: Jan 06, 2011
Posts: 36
|
|
|
In your program variable 'costPerPage' and 'currentBalance' are undefined. that's why you are getting symbol errors.
|
 |
Campbell Ritchie
Sheriff
Joined: Oct 13, 2005
Posts: 32689
|
|
|
Disagree. You are better off not using IDEs at this stage.
|
 |
Wouter Oet
Saloon Keeper
Joined: Oct 25, 2008
Posts: 2700
|
|
|
I also disagree. This is a very simple error and the compiler will tell you exactly where it is. It's a very basic mistake and for me that is an indication that the topic starter is a beginner (nothing special here in the "Beginnning Java" forum). He should get to a level where he is able to spot such mistakes and familiarize himself with Java and its classes / api's and then consider using an IDE.
|
 |
Matthew Brown
Bartender
Joined: Apr 06, 2010
Posts: 3793
|
|
But what you do need to do is tell us the lines that you're getting errors .
|
 |
Buddhika Mawella
Ranch Hand
Joined: Jan 06, 2011
Posts: 36
|
|
Matthew Brown wrote:But what you do need to do is tell us the lines that you're getting errors  .
Yes. Agree with you. that is the better way for a beginner.
|
 |
 |
|
|
subject: Compiler error cannot find symbol
|
|
|