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 / prasu

public means this method is called from out side of the
class, means we create the object out side of the class that
situation method is available to object.


viod means return type of the method is nothing.the caller
of main() i.e jvm can not recive any thing from called main().


Static means when ever the class is loaded into memory first
static block is executed so,first jvm calls main().

string args[] is an array,it will receive string type of
arguments.



why we write only that type of specification is because jvm
knows only that type of specificatroin.

Is This Answer Correct ?    4 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is a module function?

1166


What is a static method in java?

1094


Can a static class have a constructor?

1059


How to connect to a remote database using Applet?

2606


What is the purpose of main function in java?

1077


Explain the difference between jvm and jre?

1076


What is :: operator in java?

1028


Difference difference paint() and paintcomponent()?

1050


A person says that he compiled a java class successfully without even having a main method in it? Is it possible?

1109


What is reverse function?

1215


Can each java object keep track of all the threads that want to exclusively access it?

994


Can we serialize arraylist in java?

1064


Which eclipse is best for java?

1055


Can you sort a string in java?

972


What is an class?

1091