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 use of isempty in java?

963


Which java version is latest?

962


What is an example of a conditional statement?

981


Implementations of set interface?

942


What does the exclamation mark mean in java?

1168


Whats the difference between notify() and notifyall()?

970


What are keywords give examples?

997


When is the garbage collection used in Java?

1127


Is a boolean variable?

953


What are the different http methods?

975


What is variable and its types?

968


What is var keyword ?

1126


What are checked exceptions?

966


Explain public static void main(string args[]) in java.

931


Can you call one constructor from another if a class has multiple constructors?

969