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 types of methodology?

1150


What does replaceall do in java?

960


What is the purpose of using bufferedinputstream and bufferedoutputstream classes?

1118


What is the difference between stringbuffer and stringbuilder?

1106


Is call by reference possible in java?

1006


what are the disadvantages of indexes in oracle?

2632


Why we used vector class?

1114


What is argument in java?

1052


What is meant by JVM? Is JVM platform independent or not?

1128


What is java in simple terms?

1053


Is there a jre for java 11?

1126


what is the purpose of the wait(), notify(), and notifyall() methods? : Java thread

1043


v-model life cycle

2089


Difference between linkedlist and arraylist.

1112


What is the difference between integer parseint and integer valueof?

1045