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

Can we rethrow the same exception from catch handler?

1078


How we can execute any code even before main method?

1074


What is an error in java?

1092


What is tochararray in java?

876


How do you access command-line arguments within the code?

1002


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

955


why java uses class level type casting ?

2607


Is a class subclass of itself?

1025


How transient variable is different from volatile variable?

1016


What is immutable state?

939


What is thread synchronization in java?

857


What is java virtual machine? Explain

965


What is an interface in java?

1006


Which is easier .net or java?

1023


why are there separate wait and sleep methods? : Java thread

974