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 / deependra prarap singh

in the java when we creat any of the class then the "java's compiler after entering in the class ,
fistly search for the static because the java's compiler know every thing about the static
and then java's compiler search for the main method,
as we know that the main is a method then there should be some return type so we use void because it has no return type
after declaring the void now we use the public because we are to access the main method from any where or outside
"

Is This Answer Correct ?    5 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the difference between size and length in java?

927


Why are parameters used in functions?

940


Why are the methods of the math class static?

1022


Explain importance of inheritance in java?

964


What are the three types of design patterns?

918


What are the types of java languages?

929


What is final method in java?

966


is there a separate stack for each thread in java? : Java thread

929


Explain different ways of creating a thread. Which one would you prefer and why?

983


What is super in java?

935


How to compare two strings in java program?

1012


What are the different types of sorting in java?

930


Which sorting is best in java?

958


How do you calculate square roots?

1096


What is the unit of plancks constant?

985