• Post Reply Bookmark Topic Watch Topic
  • New Topic

What is wrong with my object reference ?  RSS feed

 
Ray Anderson
Ranch Hand
Posts: 98
Java Oracle Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm getting an error in my code,
RemoveChar.java:17: error: cannot find symbol
RemoveChar m = RemoveChar();
^
symbol: method RemoveChar()
location: class RemoveCharDemo
1 error

 
Ray Anderson
Ranch Hand
Posts: 98
Java Oracle Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
OK i have solved it i haven't mentioned new keyword, so it was unable create object reference.
 
Paweł Baczyński
Bartender
Posts: 2087
44
Firefox Browser IntelliJ IDE Java Linux Spring
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
And, without new keyword, the compiler was looking for a method named RemoveChar() which did not exist, thus the error.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!