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?

Answers were Sorted based on User's Feedback



what is a static block?..

Answer / madan

static block contains a code which is executed without
object of a class.i.e is excuted at the time of class
loading

Is This Answer Correct ?    6 Yes 1 No

what is a static block?..

Answer / 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

what is a static block?..

Answer / srinivasa

Static block is executed when the class is loaded into the
memory before the main(). Only once it will be executed.

Is This Answer Correct ?    3 Yes 0 No

what is a static block?..

Answer / ravikiran

static block is used to initialization during the JVM start
up

Is This Answer Correct ?    1 Yes 1 No

Post New Answer

More Core Java Interview Questions

How to write custom exception in java?

0 Answers   Cyient,


Does treeset allow null in java?

0 Answers  


What is deserialization?

0 Answers  


Is there any difference between nested classes and inner classes?

0 Answers  


Difference between a Canvas and a Scroll Pane?.

1 Answers   NIIT,


How to convert a string to long?

2 Answers  


What is command line argument

0 Answers   TCS,


what is use of business objects?

3 Answers   Tech Mahindra,


Tell me the programme for this @ 1 2 @ @ @ 1 2 3 4

5 Answers   Accenture, iGate, IntoNET, Value Labs,


Is it possible to cast an int value into a byte variable? What would happen if the value of int is larger than byte?

0 Answers  


Explain what is Marker interface?

0 Answers   BirlaSoft,


What is a map? What are the implementations of map?

0 Answers  


Categories