Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Java Gettingstartedwithjava Understanding public static void main function

Related Tutorials


 
 

Share on Google+Share on Google+

Understanding public static void main function

Advertisement
The public static void main function is important function in Java programming language.

Understanding public static void main function

     

The public static void main function is important function in Java programming language. In this section we will learn about main function.

The main method is the first method, which the Java Virtual Machine executes. When you execute a class with the Java interpreter, the runtime system starts by calling the class's main() method. The main() method then calls all the other methods required to run your application. It can be said that the main method is the entry point in the Java program and java program can't run without this method.

The signature of main() method looks like this:

public static void main(String args[])

The method signature for the main() method contains three modifiers:

  • public indicates that the main() method can be called by any object.
  • static indicates that the main() method is a class method.
  • void indicates that the main() method has no return value.

Read more about public static void main function at http://www.roseindia.net/java/master-java/underStandingHello.shtml

 

Advertisements

If you enjoyed this post then why not add us on Google+? Add us to your Circles



Liked it!  Share this Tutorial


Follow us on Twitter, or add us on Facebook or Google Plus to keep you updated with the recent trends of Java and other open source platforms.

Posted on: June 11, 2009

Related Tutorials

Discuss: Understanding public static void main function   View All Comments

Post your Comment


Your Name (*) :
Your Email :
Subject (*):
Your Comment (*):
  Reload Image
 
 
Comments:8
v.venkatraman
June 6, 2013
java

i need more details
aashish
November 3, 2011
bim

help us
Tanveer
January 10, 2012
Static.

Static indicates that main() method is a class method how?
Mr Java
December 12, 2012
Java error

Ekhem... its: public static void main(String[] args)...
kunal jha
November 17, 2012
JAVA

description of public static void main(String args[ ]) is good but i need more clearification about static.
vinay kumar
January 2, 2013
oop's through java

very nice
Lahiru
May 2, 2013
.

thanks for the info
Akash Nigam
July 18, 2013
This Post

Didn't expect this kinna explaination from roseindia..:(
DMCA.com