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...

why we write public static void main (String args[])
in core java plz explain briefly??????????????????

Answer Posted / nilay

because in JAVA everything is within class and should be
called with classname(static methods) or with instance of
that class. but main is the first method to be called when
no instances are in memory so that is why it is static and
is called like <classname>.main() by System class. and it
must be public because it is called from outside enviornent
of current class file. String[] is for the command line
arguments that you pass when you run your java program
by "java .classfile arg1 arg2" so all arguments are
received here and for multiple arguments it is an array of
strings. it does not return anything so it's return type is
void.

Is This Answer Correct ?    17 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are the advantages of assembly language?

874


What is the difference between checked exception and unchecked exception?

958


Does java support function overloading, pointers, structures, unions or linked lists?

1037


Why runnable interface is used in java?

1054


What is return keyword in java?

1008


What are the restriction imposed on a static method or a static block of code?

996


What is the byte range?

979


What is indexof?

914


Explain public static void main(string args[]) in java.

931


What is the use of list in java?

936


What are the 5 types of research methods?

1085


Explain the features of java?

966


Can you make a constructor final in Java?

1062


What is the base class of all exception classes?

1019


What is default constructors?

936