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 a static block?

Answer Posted / ranganathkini

A static block or a static initializer is a block that
appears within a class definition but outside any member
definition with the keyword static ahead of it. Example:


class MyClass {
private static double myValue;
static {
myValue = Double.parseDouble( System.getProperty(
"version" ) );
}
}

It is mainly used to perform static construction i.e.
initialization of static variables (see above example). The
static initializer is executed when the class is loaded by
the JVM.

Is This Answer Correct ?    3 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain about the interpreter in java?

1048


What is Applet Stub Interface ?

2489


How do you convert boolean to boolean?

1150


Can you instantiate the math class in Java?

1085


Is void a return type?

961


Can arraylist contain null values?

1009


What is an infinite loop? How infinite loop is declared?

1100


Define packages in java?

999


What is the difference between Java1.4 and Java1.5

2305


What are the steps involved to create a bean?

1150


What are assembly attributes?

1002


What is the purpose of a parameter?

1067


How many bits is a boolean?

1076


What an i/o filter?

1011


What are the main differences between notify and notifyAll in Java?

1088