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 procedural and object-oriented programs?

1011


What is the public field modifier?

1077


What are the high-level thread states in java programming?

1109


What is a java lambda expression?

1100


Is java platform independent?

1025


What happens if an exception is throws from an object's destructor?

1096


When a thread is executing a synchronized method , then is it possible for the same thread to access other synchronized methods of an object ?

1094


What are the different ways of creating thread?

1060


Is class forname reflection?

1034


What are the advantages of arraylist over arrays?

1147


why java uses class level type casting ?

2701


What is void keyword?

1159


What is floor in java?

1080


What is lossy conversion in java?

1278


What is a stack class in java ?

1153