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

Does it matter in what order catch statements for filenotfoundexception and ioexception are written?

957


What do you understand by abstract classes?

1077


Explain the differences between static and dynamic variables?

1154


What is mnemonic code?

1023


Can arraylist contain null values?

1024


What is the use of pattern in java?

1057


What is meant by object oriented programming – oop?

992


How do you compare arrays in java?

954


Write a java program to count the number of words present in a string?

984


What are the supported platforms by java programming language?

1047


What things should be kept in mind while creating your own exceptions in java?

1164


How do you make a thread in java?

1103


What if I write static public void instead of public static void in java?

1092


Explain wait() method of object class ?

1229


What is mean by collections in java?

1182