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

what is the difference between static block and static
method

Answer Posted / kishore reddy

static{} blocks are executed on its own as soon as the
program starts. i.e before the main method is called where
as static() is called ONLY from another static method ie
main method.

static() has several restrictions:
1. Can ONLY call other static ()
2. MUST ONLY access static data
3. cant refer to super or this

Is This Answer Correct ?    14 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are "class access modifiers" in Java?

1201


What is the difference between stream and buffer?

1017


What is volatile data type?

1066


Tell me the Importent classes in net package?

2039


What is string variable?

1106


How do you define a set in java?

1057


Describe 2 different ways to concatenate two strings.

1263


What are heap memory and stack memory and what are memory tables.

1026


What is jvm? Why is java called the platform independent programming language?

1076


What is preflight request?

1090


What does \ mean in regex?

1318


What is the advantage of functional interface in java 8?

1046


What is the default access specifier for variables and methods of a class?

1253


What are the types of inner classes (non-static nested class) used in java?

1109


Does java set allow duplicates?

1131