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 / marrapu venkatesh.

Public: the reason for using public is to be accessed by the jvm. if u write private it should not be recognized by the jvm to execute. public methods accessed out of the class that's why we write public.
Static: the reason for static is when the program execution start main method should be invoked first. static method is called first. because we cant create object to main class to call methods. that's why we write static.
Void: In java main function does not return any value.

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Mention a package that is used for linked list class in java.

952


what is the difference between the methods sleep() and wait()? : Java thread

953


How are this() and super() used with constructors in java programming?

1055


Can we change the value of static variable?

948


Does java support multiple inheritances?

1011


What is a qualifier in a sentence?

984


Can we inherit a class with private constructor?

1109


What is included in core java?

1052


What sorting algorithm does javascript use?

973


What is floor in java?

1034


Why java uses the concept of the string literal?

1048


What is an example of declaration?

995


What is numeric function?

989


How do I enable java in safari?

1021


What is the difference between normal report & matrix report?

1094