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

How transient variable is different from volatile variable?

1070


How do constructors use this() and super()?

1110


What is meant by 'Class access modifiers'?

1042


Do you know how to reverse string in java?

1142


Do you know why doesn't the java library use a randomized version of quicksort?

949


What is an infinite loop? How infinite loop is declared?

1097


Can we have multiple catch block for a try block?

989


What is a vararg?

1028


What are the string methods in java?

1084


What does provide mean construction?

1099


How does varargs work in java?

1084


How to reverse string in java?

1197


What are the three types of design patterns?

957


When a lot of changes are required in data, which one should be a preference to be used? String or stringbuffer?

1236


Which is better stringbuffer or stringbuilder?

911