• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Tim Cooke
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Devaka Cooray
  • Ron McLeod
  • paul wheaton
Saloon Keepers:
  • Tim Moores
  • Piet Souris
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Frits Walraven
  • Scott Selikoff

Compiler error cannot find symbol

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Im not sure where the problem is help would be greatly appreciated



error is refering to the line public static string studentName
 
Bartender
Posts: 2700
IntelliJ IDE Opera
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Janice Twomey
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks a lack of sleep is catchin up with me
 
Bartender
Posts: 4568
9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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!
 
Ranch Hand
Posts: 40
Eclipse IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Janice Twomey
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I've fix a good bit but I'm still getting symbol errors

 
Buddhika Mawella
Ranch Hand
Posts: 40
Eclipse IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
In your program variable 'costPerPage' and 'currentBalance' are undefined. that's why you are getting symbol errors.
 
Marshal
Posts: 76792
366
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Disagree. You are better off not using IDEs at this stage.
 
Wouter Oet
Bartender
Posts: 2700
IntelliJ IDE Opera
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 4568
9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
But what you do need to do is tell us the lines that you're getting errors .
 
Buddhika Mawella
Ranch Hand
Posts: 40
Eclipse IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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.
 
reply
    Bookmark Topic Watch Topic
  • New Topic