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 / xyz

Public -> Because we want to access the main from the out side of the class generally when we run the java program at that time it call the main method.

Static ->Because it will create only one copy of main method and we can call with class name so when we run program it will
run main method using passed program name like name.main();

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Why does java doesnt suuport unsigned values?

2174


How do you use compareto in java?

924


Give reasons supporting that string is immutable.

890


What is skeleton and stub?

985


How do you format in java?

938


What is meant by class?

949


What is threaded programming and when is it used? : Java thread

1015


What is the tradeoff between using an unordered array versus an ordered array?

1161


What are serialization and deserialization?

1193


Is upper case in java?

921


What is "this" keyword in java? Explain

1049


Is there any difference between nested classes and inner classes?

1027


What does string [] args mean?

953


What is the purpose of declaring a variable as final?

915


what is the major difference between linkedlist and arraylist in java?

1099