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

In a container there are 5 components. I want to display all the component names, how will you do that?

2184


Why there is no call by reference in java?

910


Which command from the jdk compiles a java program?

973


What is a void method?

918


What are the different types of sorting in java?

969


How many types of design patterns are there?

1093


What are java methods?

1089


Implement two stacks using a single array.

1049


What are the basics of core java?

1009


What is arguments in java?

995


How do you add an element to a hashset in java?

997


What is mnemonic in assembly language?

1065


What are the practical benefits, if any, of importing a specific class rather than an entire package (e.g. Import java.net.* Versus import java.net.socket)?

1108


How many types of exception can occur in a java program?

977


What is the use of singleton?

953