• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

any one tell me?

 
manish kr. pandey
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
the main method of java


public static void main(String x[])

in which class this method belong?
 
Matthew Brown
Bartender
Posts: 4567
8
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 12149
31
Chrome Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic