File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Beginning Java and the fly likes error: can not find symbol method Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "error: can not find symbol method" Watch "error: can not find symbol method" New topic

error: can not find symbol method

sahar sa
Ranch Hand

Joined: Jul 06, 2009
Posts: 102
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,
Seetharaman Venkatasamy
Ranch Hand

Joined: Jan 28, 2008
Posts: 5575

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é

Joined: Nov 24, 2005
Posts: 14688

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)

[My Blog]
All roads lead to JavaRanch
David Newton

Joined: Sep 29, 2008
Posts: 12617

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

Joined: Oct 02, 2003
Posts: 11955

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.

There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors
I agree. Here's the link:
subject: error: can not find symbol method
It's not a secret anymore!