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 / manik kumar bardhan

public means access specifier
static means
in general we always start execution from main()
but in java main() exist with in a class so when ever we r
executing any method which r within the class we need
instance variable to execute that method(a.print()) but here
without creating any instance main method will execute first
b/c static is the keyword which used for method then method
become a associated with class.for execution of that method
no need create instance.
void :return type
main is the method where java compiler starts execution.

Is This Answer Correct ?    3 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the difference between delete and delete[]

1643


Explain different types of wrapper classes in java?

1072


What are the main uses of the super keyword?

1016


What is meant by polymorphism?

1071


Explain exception chaining in java?

1222


How do you replace a string in java?

1052


What are Normalization Rules? Define Normalization?

1106


What are desktop procedures?

1097


What is a two-pass assembler?

1100


What is thread life cycle in java?

1136


When do we use synchronized blocks and advantages of using synchronized blocks?

1278


What are the methods of object class ?

1099


Can we execute java program without main method?

1191


What is parsing in java?

1013


What isan abstract class and when do you use it?

1665