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...

when everything can be done by static block then why do we
use main method?.

Answer Posted / guest

the main block is declared as static sothat the java
interpreter could use it without instantiating it,but if we
declare everything as static there is no meaning of a class
and specifying instance variables and methods belong to
that specific class only.

Is This Answer Correct ?    2 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

why would you use a synchronized block vs. Synchronized method? : Java thread

936


Can we override private method in java?

1077


How are variables stored?

961


What does i ++ mean in Java?

931


Explain a few methods of overloading best practices in java?

964


How the metacharacters are different from the ordinary characters?

1007


Can a static member function access member variable of an object?

990


Why main function is static?

1203


What is the byte range?

1018


Can we have multiple catch block for a try block?

971


Is list ordered in java?

956


What is string variable?

1033


What is hashmap and map?

998


What is the difference between import java.util.date and java .util?

1041


Can we initialize the final blank variable?

1075