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

Why main method is called first in java?

1056


How do you sort a list in java?

1074


Can we sort arraylist in java?

1040


What is the use of arrays tostring () in java?

1070


How many types of methods are there?

1117


Why are data types important?

1184


Why stringbuffer is faster than string?

1089


What happens when you add a double value to a string?

1056


What is a nonetype?

1173


What is the list interface?

1128


What checkbox method allows you to tell if a checkbox is checked?

1052


What is consumer interface?

1066


What are the characteristics of java?

1120


What is map java?

1030


What is the difference between JDK and JVM?

1337