File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Beginning Java and the fly likes any one tell me? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
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: 4391
    
    8

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: 11313
    
  16

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.


There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: any one tell me?