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

public is written so that it can be called from outside and
static is written because main is called before the creation
of any object and for static methods object is not required.

Is This Answer Correct ?    1 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Write an algorithm for quick sort?

1081


Can we override the private methods?

1058


Is string passed by reference in java?

1042


What is an immutable class? How to create an immutable class?

1115


How do you remove duplicates in java?

1070


What are the procedures?

1109


What is the benefit of lambda expressions?

1132


Is java a prime method?

1038


how many types of Inheritance?

1211


What is meant by interface?

1101


Can constructor return value?

1010


What are the advantages of unicode?

1057


What is advantage of java?

1068


Can we declare array without size in java?

1078


If an object reference is set to null, will the garbage collector immediately free the memory held by that object?

1195