• Post Reply Bookmark Topic Watch Topic
  • New Topic

cannot find symbol error  RSS feed

 
Dan Ryan
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi I'm trying to complete this ChangeMaker program and I can't figure out what to do about the error message that I have. Could someone please help me?
It says this:

cannot find symbol
symbol: method readLine()
location: variable SimpleIO of type Object


The error is showing on the word readLine that I have in red below
Here is my code:



 
Nam Ha Minh
Ranch Hand
Posts: 515
Eclipse IDE Firefox Browser Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That means the SimpleIO object does not have the method readLine(). You must either implement that method or find it elsewhere in other libraries/API (typically the Java File IO API).
 
Dan Ryan
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That makes sense. Thanks. didn't understand the error
 
Campbell Ritchie
Marshal
Posts: 56562
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the Ranch

Check carefully what sort of class SimpleIO is: you declared it as Object, which is is (every object is an Object, but Object has eleven methods, which do not include readLine. Also check whether readLine is an instance method of simpleIO or a static method. If it is static, then you don't need a reference to an object and you should remove the declaration.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!