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 environment variables do I need to set on my machine in order to be able to run java programs?

960


Is java a software?

891


Can we return null in java?

1064


What is private static in java?

995


Explain reverse a linked list recursive java solution?

934


Explain purpose of sleep() method in java?

1056


What is the simpletimezone class in java programming?

1077


Is java a security risk?

959


What data type is true or false?

987


How does queue work in java?

930


What is java util?

972


How does java pattern compile work?

908


What is a double vs float?

943


What is Java Shutdown Hook?

1114


Why java is not 100% object-oriented?

1429