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 / prabhakant prabhakar rasal

We write public because to access main() method outside the
class.
Why static because to invoke main() method before creating
any object, so it simple to compiler that to identify the
main() method.
void, it represents that it does not returns any value.
string args[]
There are two main reasons to write string args[]
1. TO identify the program
2. To get command_line arguments

Is This Answer Correct ?    27 Yes 13 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are the methods available in a class?

1125


What is scope & storage allocation of static, local and register variables? Explain with an example.

1048


What is the difference between an inner class and a sub-class?

1064


What is the difference between conversation & casting?

1091


Can list be null in java?

1097


How many types of equations are there?

1064


List some java keywords sun like c, c + + keywords?

1059


Which is easier netbeans or eclipse?

1105


What is stack explain?

1073


What is navigable map in java?

1028


Tell me about your ability to work under pressure

2246


What is arraylist e?

1138


What is a dynamic array java?

987


What is a local, member and a class variable?

1089


Why java applets are more useful for intranets as compared to internet?

1125