aspose file tools*
The moose likes Beginning Java and the fly likes Learning overloading but have a problem with code Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Learning overloading but have a problem with code" Watch "Learning overloading but have a problem with code" New topic
Author

Learning overloading but have a problem with code

Billy White
Greenhorn

Joined: Nov 28, 2010
Posts: 4
I am working with overloading an thought the following code would work. When I compile it in DrJava, it compiles just fine. But when I try to run it I get the following message:

run Overload
Static Error: This class does not have a static void main method accepting String[].

I don't quite understand why, since I have a main method in the MethodOverloading class, that it wants a main method in the Overload class.
Thank you for your help.


Joel Christophel
Ranch Hand

Joined: Apr 20, 2011
Posts: 237
    
    1

Name your file after the class that contains main, and also make that class public.
Billy White
Greenhorn

Joined: Nov 28, 2010
Posts: 4
Thank you. I had the file named right and I should have known better than to not make the method public. Thanks again.
Joel Christophel
Ranch Hand

Joined: Apr 20, 2011
Posts: 237
    
    1

No problem!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Learning overloading but have a problem with code