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 / hemanth kumar kalavagunta

Yes ... when everything can be done by static block then why
do we use main method. this is because, main method is the
only step from which compiler can enter the program to start
and this is the only way through which the data from outside
jvm can be entered into the jvm in the form of command line
arguments. using the static blocks there is no way to get
the data from the outside of the program and it is confined
to the program and program is it's world. main's world is
related both with the inside of jvm and outside of jvm.

Is This Answer Correct ?    12 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Is singleton thread safe in java?

983


What is the vector class in java programming?

1082


Is java based on c?

990


What do you understand by the bean persistent property?

1006


What is difference between throw and throws ?

1136


How to run a JAR file through command prompt?

1278


What is the default value of the local variables?

1018


Where is java located?

1047


What is JFC?

1233


Why hashmap is used in java?

1089


What are autoboxing and unboxing? When does it occur?

947


What are filterstreams?

1073


Mention a package that is used for linked list class in java.

975


Define a package.

1079


What are implicit objects in java?

977