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 / rana

As we know public means we can access the method from
anywhere.Coming to static:- main() is a static method
therefore it implies that there is no need of creating
Object for that particular class to call this method.So
that when ever u run the program the Jvm will search for
main() in the class even there r no class objects created
for this class.

Is This Answer Correct ?    20 Yes 7 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are java packages?

1035


Can singleton class be cloned?

1052


Can we assign the reference to this variable?

977


What does .equals do in java?

1099


Can we override tostring method in java?

971


What is the reflection?

1008


What is java and why do we need it? Explain

1139


What are the features of junit?

1045


How do you end a program?

1118


What is the difference between static and global variables and also define what are volatile variables?

1052


What is the covariant return type?

1100


Explain the difference between abstraction and encapsulation.

981


What is a dynamic array in java?

1181


What differences exist between iterator and listiterator?

1047


How to access arraylist elements in java?

996