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

Can we declare an interface as final?

1067


How are variables stored in memory?

1075


What are dot operator queries?

1107


What is not thread safe?

984


What is int short for?

1051


What is the hashcode () and equals () used for?

1039


What is ellipsis in java?

1088


What does n mean?

1001


Explain the difference between jvm and jre?

1040


Explain creating threads by extending thread class ?

1057


What is boolean false?

986


What is sortedset in java?

1034


What is meant by data hiding/encapsulation?

1106


What is a dot notation?

1036


what is meant by Garbage collection?

1094