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

What is style and indentation?

955


Why spring singleton is not thread safe?

959


Can a java program have 2 main methods?

1001


What is mutable object and immutable object?

1082


What is memory leak and how does java handle it?

936


What is bitwise complement?

928


What is the difference amongst jvm spec, jvm implementation, jvm runtime ?

914


What is the static variable?

1055


Garbage collection in java?

955


What is the access scope of protected access specifier?

936


Write a code to create a trigger to call a stored procedure

910


What is a key in java?

933


Difference between default and protected access specifiers?

1030


How will you print number in reverse (descending) order in BST.

944


What is keyword auto for?

1106