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

if we don't use public in main method jvm is looked for main
method but does not found.so run time error will occurred
"main() method must be declared as public". why its static
means in java we can execute methods with object.if we use
static it will execute without object.

Is This Answer Correct ?    2 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Can we have try block without catch block?

1038


What is the difference between an array and an array list?

1031


What is the abstraction?

1027


Can inner class final?

1105


How do you invoke a method?

1010


What is the default value of byte datatype in java?

942


What is the use of static class?

1198


What is procedure writing?

985


Is a string literal?

1109


What is the difference between hashset and treeset in java?

1074


I am unable to find or learn about print command. I have a graphical program in core java in applet but i want to give print command but i have coding for that so if anyone know about this plz mail me on avdhesh_chauhan007@yahoo.co.in

2107


When should you use arraylist and when should you use linkedlist?

936


What is a qms manual?

1004


Explain reverse a linked list iterative solution in java?

930


Can a variable be local and static at the same time?

1012