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...

In Java why we write public static void main(String args[])
why not main()?

Answer Posted / kedar

static methods can be accessed without creating object object of class, we know that file name of java program is "classname.java", "classname" is the class which contain main function, so it is easier for compiler to locate class which contain main(), and because of static nature it can execute it.

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the main method java?

977


Which access specifier can be used with class ?

952


What is stringreader?

907


What do you mean by an object in java?

1082


what is optional in java 8?

1016


make a method which any number and any type of argument and print sum of that arguments.....

1754


What is the meaning of 3 dots in java?

1115


what is mutual exclusion? : Java thread

970


What is the purpose of java?

949


Difference between association, composition and aggregation?

935


What does .equals do in java?

1021


Which is the best sorting technique in java?

936


What is the advantage of OOP in java?

1089


What ide should I use for java?

967


Can we write a class without main method in java?

904