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

Are strings immutable in java?

990


Is array passed by reference in java?

1032


What is Java Package and which package is imported by default?

1098


What is oop principle in java?

1168


What are constants and how to create constants in java?

986


How to invoke external process in java.

1081


What do you understand by a Static Variable?

1217


Hi Anyone know the model / questions of the Federal bank sample questions for the post of Specialist Officers - Programmers. Please post if anyone have..

2308


How do you use compareto method?

1021


Explain about the select method with an example?

1184


Difference between current previous versions of Java?

1028


How many types of flags are there?

1017


How to display all the prime numbers between 1 and n (n is the number, get the input from user)

983


What are synchronized methods and synchronized statements in java programming?

1024


What happens when I use / and % with a negative numerator?

1045