Home Java Gettingstartedwithjava Understanding public static void main function



Understanding public static void main function
Posted on: June 11, 2009 at 12:00 AM
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

 

Related Tags for Understanding public static void main function:
cfunctionfuniothisaiunclearneareilmainsectioninmoutfuncsislleaarssthabono


More Tutorials from this section

Ask Questions?    Discuss: Understanding public static void main function   View All Comments

Post your Comment


Your Name (*) :
Your Email :
Subject (*):
Your Comment (*):
  Reload Image
 
 

Ask Questions?

If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.

Ask your questions, our development team will try to give answers to your questions.