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 the purpose of the System class?

949


What are the three parts of a lambda expression? What is the type of lambda expression?

977


What is static block?

1057


describe method overloading

955


Explain about doubly linked list

972


Which arithmetic operations can result in the throwing of an arithmeticexception?

970


When do we use synchronized methods in java?

989


What is a parameter in matrices?

982


What do you mean by Function Overloading in java?

1125


Can we create our own daemon thread?

924


How do you start a thread?

977


Can an interface be final?

972


What is thread life cycle in java?

1006


How big is a gigabyte?

989


Why does java not support operator overloading?

1082