View Single Post
  #17 (permalink)  
Old 07-27-2008, 06:26 AM
Eranga's Avatar
Eranga Eranga is offline
Moderator
 
Join Date: Jul 2007
Location: Colombo, Sri Lanka
Posts: 7,523
Rep Power: 11
Eranga has a spectacular aura aboutEranga has a spectacular aura about
Send a message via Yahoo to Eranga
Default
Cool, I give the first point. In any class main method is the stating point. If any of your class doesn't have a main method, that me you can't run that class, because you don't have a starting point to directed to the Java Runtime Environment.

Since to run a class each one of it have a main method, which should be a static one. So that JVM initialize only one main method for a class, until it reaches to the end.

So your main method should like this.

Code:
public static void main(String[] args) {
    // Your implementation goes here
}
__________________
Use an appropriate Subject. "Help, urgent!" isn't one.
Someone helped you? their helpful post.
Help:Forums FAQ|How To Ask Questions The Smart WayResources:The Java Tutorials|Glossary for Java|NetBeans IDE|Sun DownloadsWeb:WritOnceTips:Is your IDE the best?|Which Application Server?
Reply With Quote