wood burning stoves 2.0*
The moose likes Java in General and the fly likes In which pakage or class is the java main method Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "In which pakage or class is the java main method" Watch "In which pakage or class is the java main method" New topic
Author

In which pakage or class is the java main method

jeyakanth yogaratnam
Greenhorn

Joined: Jun 25, 2005
Posts: 9
hello there

i want to know in which package or class is the java main method is in. Tell me the hyararchy, in which it is. And also i want to know whether the main method can be revoked in another method without the static modifier. plz reply me, for i am stuck here with this.

thanks
jeyakanth
Ernest Friedman-Hill
author and iconoclast
Marshal

Joined: Jul 08, 2003
Posts: 24187
    
  34

When you write a Java program, you write the main() method. The JVM launcher program (which is written in C, not in Java) finds your class and invokes main(). Does this answer your question?


[Jess in Action][AskingGoodQuestions]
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336


i want to know in which package or class is the java main method is in

The main method is in whichever class you put it in.


And also i want to know whether the main method can be revoked in another method without the static modifier.

You can call static methods in a non-static way (i.e. by creating an instance and calling the method on that instance), if you want to. You shouldn't though (that is, assuming by 'revoked' you mean 'invoked').


JavaRanch FAQ HowToAskQuestionsOnJavaRanch
 
 
subject: In which pakage or class is the java main method