• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Learning overloading but have a problem with code

 
Billy White
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 250
1
Chrome Eclipse IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Name your file after the class that contains main, and also make that class public.
 
Billy White
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 250
1
Chrome Eclipse IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No problem!
 
Don't get me started about those stupid light bulbs.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic