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 / amardip sabale

we write public static void main() because
public:for access of main function all over the program
static:main is also one type of method,and for calling this
method while running our program without creation of any
object
void:because it is not return anything
String args[]:because when we run our program then always
we pass at least two command line arguments(java and
program name)for collecting them we have to write it
*THANKS*

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What happens when a thrown exception is not handled?

1114


How to solve the problem of generating the unique hash keys with hash function?

1916


What is an i/o filter?

1819


What do you mean by stream pipelining in java 8?

1229


What modifiers are allowed for methods in an interface?

1163


What is the significance of java packages?

1106


Why strings in java are called as immutable?

991


What is byte value?

991


What does substring mean?

976


What is one third plus one third as a fraction?

937


How many arguments can a method have java?

1026


What are the different http methods?

1034


What a static class can contains?

1154


When can an object reference be cast to an interface reference in java programming?

1023


Can we overload the methods by making them static?

1002