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

What is the purpose of main function in java?

1030


What is the difference between jdk and jre?

1063


What is the difference between normal report & matrix report?

1110


Is java free for commercial?

922


State one difference between a template class and class template.

1068


Is c better than java?

960


what is synchronization? : Java thread

1023


Why are the objects immutable in java?

986


What does n mean in java?

969


What is the final access modifier in java?

1078


How to retrieve data from database in java using arraylist?

1054


Is arraylist an object in java?

1159


What is a hashmap used for?

1247


Can we change the scope of the overridden method in the subclass?

1389


what is meant wrapper classes?

1204