This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
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 Android Security Essentials Live Lessons this week in the Android 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: 24183
    
  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
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: In which pakage or class is the java main method
 
Similar Threads
public static void main method
calling of main()
public static void main(String agrs[])
How Elegant Is This Solution? Can You Offer Me Recommendations?
methods, instances and arrays - swimming in the ocean of java