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

How we can make copy of a java object?

1100


What are the types of casting?

1066


When should a function throw an exception?

1046


What are invisible components?.

2145


Can we serialize static variables in java?

1094


Distinguish between a predicate and a function?

987


what are Hostile Applets?

2081


What is the latest java version?

1060


What is a local class in java?

1040


Explain the difference between extends thread vs implements runnable in java?

1130


Give few difference between constructor and method?

965


What is a numeric string?

1027


Is linkedlist thread safe in java?

997


How to make a write-only class in java?

1057


What is set in java?

1045