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 / ashish jindal

public static void main(String ashish[])
1. PUBLIC:- it is a access modifier through which a class or
a data member can be accessed anywhere. Main Class is Public
because it is called explicitly by Java Virtual Machine.

2. Static:- Static is used to call the main without creating
object. If Static is not used then it will behave like a
instance member function and instance member functions can
change the properties of its own object's members and functions.

3. Void:- Main do not returns any value.

4. String:- In java everything is accepted as a string.

Is This Answer Correct ?    7 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the difference between synchronized and synchronized block?

1011


What is the largest long allowed by java?

1014


What is the difference between hashmap and hashtable in java?

1055


Can you explain inner class.

1024


Explain about narrowing conversion in java?

966


When do you get classcastexception?

986


What is boolean false?

934


What is the difference between form & report?

994


Does java return by reference?

957


What are operators and its types?

1008


Which is faster call by value or call by reference?

872


What is the difference between the file and randomaccessfile classes?

1041


What is a stringbuffer?

926


Explain creating threads by extending thread class ?

1013


Why we use multi threading instead of multiprocessing?

1009