• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

please help in rectifying error :Symbol not found

 
Ankeet Maini
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

THE ERROR

SimpleDotComTester.java:64: cannot find symbol
symbol : method getUserInput(java.lang.String)
location: class GameHelper
String guess = h.getUserInput("Enter your choice :");
^
1 error


Please rectify this error...and tell why the heck it is coming??
 
pete stein
Bartender
Posts: 1561
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Do you have more than one GameHelper.java classes floating around? Have you compiled the GameHelper.java file before using it?

Also, when posting code here, please use code tags so that your code will retain its formatting and thus will be readable -- after all, your goal is to get as many people to read your post and understand your code as possible, right?

To do this, highlight your pasted code (please be sure that it is already formatted when you paste it into the forum; the code tags don't magically format unformatted code) and then press the code button, and your code will have tags.

Another way to do this is to manually place the tags into your code by placing the tag [code] above your pasted code and the tag [/code] below your pasted code like so:

 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64618
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the Ranch! Please be sure to use code tags when posting code to the forums. Unformatted or unindented code is extremely hard to read and many people that might be able to help you will just move along to posts that are easier to read. Please click this link ⇒ UseCodeTags ⇐ for more information.

Properly indented and formatted code greatly increases the probability that your question will get quicker, better answers.
 
Ankeet Maini
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thnks pete...i'm new to this forum...so missed these finer technicalities..

And yes, i've compiled the GameHelper.java individually too...and no error was reported..and there is no other GameHelper.java hanging around..

I cant understand why "SimpleDotComTester" is not able to access "getUserInput()" as i have declared that under "public" specifier...

HELP HELP!!
 
Henry Wong
author
Marshal
Pie
Posts: 20882
75
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ankeet Maini wrote:
I cant understand why "SimpleDotComTester" is not able to access "getUserInput()" as i have declared that under "public" specifier...


It looks like the method is declared as getUserlnput(), while it is called as getUserInput().... notice that the two names are not the same.

Henry
 
Ankeet Maini
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Henry Wong wrote:
Ankeet Maini wrote:
I cant understand why "SimpleDotComTester" is not able to access "getUserInput()" as i have declared that under "public" specifier...


It looks like the method is declared as getUserlnput(), while it is called as getUserInput().... notice that the two names are not the same.

Henry


Please enlighten Henry...I cant cite the difference..
 
Ankeet Maini
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ankeet Maini wrote:
Henry Wong wrote:
Ankeet Maini wrote:
I cant understand why "SimpleDotComTester" is not able to access "getUserInput()" as i have declared that under "public" specifier...


It looks like the method is declared as getUserlnput(), while it is called as getUserInput().... notice that the two names are not the same.

Henry


Please enlighten Henry...I cant cite the difference..

Thanks a lot mate...i found it...
 
David Patrzeba
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Your call is:



however in the GameHelper class you define that function as:



Look at the "i's" i != I.
 
Ankeet Maini
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you all!!
 
Ankeet Maini
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
David Patrzeba wrote:Your call is:



however in the GameHelper class you define that function as:



Look at the "i's" i != I.
Thanks David for your detailed solution...
 
Rob Spoor
Sheriff
Pie
Posts: 20493
54
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Almost right David. It was an l (lowercase L), not an I.
 
Campbell Ritchie
Sheriff
Posts: 48381
56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please avoid coloured text and different text sizes; they make your posts annoying to read.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic