This week's book giveaway is in the Agile and other Processes forum.
We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes any one tell me? Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Beginning Java
Reply Bookmark "any one tell me?" Watch "any one tell me?" New topic
Author

any one tell me?

manish kr. pandey
Greenhorn

Joined: Aug 30, 2011
Posts: 14
the main method of java


public static void main(String x[])

in which class this method belong?
Matthew Brown
Bartender

Joined: Apr 06, 2010
Posts: 3793
    
    1

Welcome to The Ranch!

Quick answer: whichever class you want to start the program in.

That method isn't part of the standard Java libraries. It's a particular signature that the Java run-time will look for whenever you try to "execute" a class.
fred rosenberger
lowercase baba
Bartender

Joined: Oct 02, 2003
Posts: 9948
    
    6

Some folks might say "all of them". You can write a project with hundreds of classes, and each and every one can have a main method.


Never ascribe to malice that which can be adequately explained by stupidity.
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: any one tell me?
 
Similar Threads
First GUI program
How to call a stand alone class from WAS???
Garbage collection problem
Help with First Java Code - Party.Java
No such method? Kathy & Bert's book p. 78-79