• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

error: can not find symbol method

 
sahar sa
Ranch Hand
Posts: 102
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear,
I have a method and I want to call this method from another class but it throws me error:
can not find symbol method FindSellerNum(String)
I searched and I find that I need to put parenthesis for my argument, and I did + I need to start my method name by capital which I did.I also import my method "import booktrading.FindSellerNum;." but error is still there! is any thing else wrong hereI can't see?

here is the class code who calls method FindSellerNum:


and here is the method to be called:



can you please explain me why this error comes out or give me a good source
Thank you,
Sahar.
 
Seetharaman Venkatasamy
Ranch Hand
Posts: 5575
Eclipse IDE Java Windows XP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
sahar sa wrote:
I have a method and I want to call this method from another class but it throw me error:


Create an Object for that class which has FindSellerNum method.



But you need to follow coding standard
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Your method name is the same as the classname, which is not a good idea, unless this is the constructor class (which is not, since you return an int)
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
And, in general, method names should start with a lower-case letter, to avoid confusing people looking at your code. This is the typical Java coding standard for naming methods.
 
fred rosenberger
lowercase baba
Bartender
Pie
Posts: 12100
30
Chrome Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You could also make it a static method, and then not have to create the object. You'd still have to call it by referring to the class name, similar to how the Math class' methods work.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic