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 / manikandan

in java , the entry point for execution is Main(),

it is tha first method to be invoked .

so PUBLIC is declared for no duplicates should occur and for
global declaration .

VOID , the main method will not return any value . So void
is declared .

Finally STATIC , in java everything is accssed through
objects . But here main() is the first method to be invoked
. STATIC is defined for this purpose , If a method is
declared as STATIC it can called without any objects
reference .

So the Main() in java is defined as

public static void main(String args[])

Is This Answer Correct ?    50 Yes 15 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is integers and example?

980


Where are the local variables stored?

1070


If system.exit (0); is written at the end of the try block, will the finally block still execute?

1102


What are the two ways of implementing multi-threading in java?

1494


How do you generate random numbers in java?

1002


What’s meant by anonymous class?

1078


What is arrays sort in java?

956


How do you declare a destructor in java?

990


What are the parts of methodology?

968


Which methods cannot be overridden in java?

983


How do you add an element to a set in java?

1022


Why char array is favored over string for the storage of passwords?

1067


What is flush buffer?

1042


Is 64bit faster than 32 bit?

1065


Explain about core java?

1111