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 is bufferedreader in java?

1039


What is difference between iterator and enumeration in java?

982


When to use runnable interface vs thread class in java?

965


What is hashmap and map?

1002


how to run ecllipse with jettyserver for windows environment using batch file

2070


What is difference between iterator access and index access?

1049


Can list be null in java?

1023


What are the uses of java?

1077


Java is pass by value or pass by reference? Explain

977


How many bits is a double?

983


What is jvm? How its run?

1073


How many types of string data types are there?

1080


What is multi-catch block in java?

1067


What is meant by polymorphism?

1016


What is array in java?

996