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

What are the basic concepts of OOPS in java?

971


Explain the difference between jdk, jre, and jvm?

994


What is purpose of find feature?

1033


What is the difference between C++ and Java and your preferences?

1065


What is the class in java?

959


How do you print array in java?

921


What are the restrictions imposed by a Security Manager on Applets?.

2557


How does enum work in java?

961


What are the Class Libraries ?

999


What is a null check?

934


What is the static variable?

1050


How will you get the platform dependent values like line separator, path separator, etc., ?

953


What is the intersection and union methods?

978


Why we go for collections in java?

919


What are the Static and Dynamic Variables? Differentiate them.

1044