Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

In Java why we write public static void main(String args[])
why not main()?

Answer Posted / preetham m.s.

he 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.

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Which package has light weight components?

1044


Explain about fail fast iterators in java?

1117


If two threads have same priority which thread will be executed first ?

1572


What is the difference between hashmap and hashtable in java?

1173


What is r in java?

1106


What are the Main functions of Java?

1129


What is use of inner class in java?

1236


How many bytes are a float?

1031


What is the instance of an object?

1268


Explain wait(), notify() and notifyall() methods of object class ?

1112


what is use of functional interface in java 8?

1088


What are different access specifiers in java?

1058


What is the static block?

1116


Where is stringbuffer stored?

1043


Can you write a java class that could be used both as an applet as well as an application?

1000