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 hashset is used in java?

1057


How do you convert bytes to character in java?

989


What is integer parseint?

980


What does indexof mean?

1007


What does those terms actually mean included in the j.d.k i.6?

2114


What is the argument in java?

900


What is a void in java?

1153


What is array list in java?

1069


How to create an interface?

1073


What is the class in java?

1004


What is the abstraction?

1012


What is the common usage of serialization?

1130


What is foreach loop in java?

1000


Differentiate between stringbuffer and stringbuilder in java.

1014


Can private method static?

905