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...

Why do we use public static with the main function in Java?

Answer Posted / balaji kumar

public - it can be access outside of the(class, package,
subclass and world).

Static- It is used to run a method without any references of
a class. Then JVM will check all the 'static' methods in
"main class" and run the main method from those.

void- main method always has no return value to outside
methods or others. so it uses void keyword.

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How do you escape a string?

913


What is keyset in java?

1013


What is the difference between && and & in java?

1024


Explain which of the following methods releases the lock when yield(), join(),sleep(),wait(),notify(), notifyall() methods are executed?

1029


Name some OOPS Concepts in Java?

1019


What is a lambda expression ? What's its use ?

1047


Explain method overloading?

963


Explain the private field modifier?

1025


Can we have more than one package statement in the source file?

1021


Can a function return a function?

987


How do you invoke a method?

950


Can we declare the static variables and methods in an abstract class?

938


Which is dependent variable?

837


Why we use protected in java?

932


How can you share data between two thread in Java?

896