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

How to use arraylist in java netbeans?

1092


List some oops concepts in java?

1087


What happens if main method is not static?

1048


Is empty in java?

1107


How do you write a good declaration?

1026


What is method reference in java?

1191


What is the access scope of protected access specifier?

1038


What mechanism does java use for memory management?

1019


Will the compiler creates a default constructor if I have a parameterized constructor in the class?

1164


What is the purpose of static methods and variables?

1081


Can we able to pass objects as an arguments in java?

1080


How can you avoid serialization in child class if the base class is implementing the serializable interface?

1123


what is nested class in java?

1224


What is local variable and instance variable?

1101


Is there a way to increase the size of an array after its declaration?

1086