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 re-factoring in software?

1101


What is meant by object oriented programming – oop?

1045


Why pointers are not used in java?

1177


Name and explain the types of ways which are used to pass arguments in any function in java.

1126


What is the integer of 16?

1038


What is meant by anonymous class?

1088


What is not object oriented programming?

988


What are the special characters?

1014


How can we find the sum of two linked lists using stack in java?

1241


Can we override the private methods?

1058


Can you explain inner class.

1138


If an application has multiple classes in it, is it okay to have a main method in more than one class?

1055


Can there be an abstract method without an abstract class?

1006


What is the argument in java?

983


Why do we need wrapper class?

1038