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

What are local variables?

1042


What is numeric data type?

977


What is number data type in java?

1004


How to create an interface?

1074


Explain the term virtual machine?

1038


How do generics work in java?

1016


What is the difference between the Reader/Writer class hierarchy and the InputStream/OutputStream class hierarchy?

1128


What is difference between word and integer?

1070


Difference between arraylist and hashset in java?

1123


What is difference between static class and singleton pattern?

1017


What is an example of a boolean?

1044


which one is more efficient int x; 1. if(x==null) 2.if(null==x) state which one either 1 or 2?

11162


What are the two types of java programming?

1053


Why are there no global variables in java?

1039


What is the purpose of default constructor?

994