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

Differentiate between run time error and syntax error.

1137


What is complexity and its types?

1033


What are the advantages and disadvantages of reference counting in garbage collection?

1029


What is linked hashmap and its features?

1009


What is hashtable and explain features of hashtable?

989


How many types of methods are there in java?

1009


Why do we use string?

1045


Which class is the superclass of all classes?

1110


What do you mean by stream pipelining in java 8?

1229


How does thread synchronization occurs inside a monitor? What levels of synchronization can you apply?

963


Write a program in java to calculate the difference between the sum of the odd level and even level nodes of a binary tree.

1061


Where are register variables stored?

1018


What is double checked locking in singleton?

1058


what is singleton in java?

1053


What are adapter classes?

1051