can we create a object in static block
class A
{
static {
A a=new A();
}
}

Answer Posted / naresh tuhania

Yes we can do this . Because we can create an object at
runtime and static block is also execute when a class is
loaded by the class loader at runtime

Is This Answer Correct ?    3 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the base class for all swing components?

608


What is the function of internal frame in swing?

613


What method is used to specify a container's layout?

520


What is the what is the difference between invokeandwait() and invokelater()? ?

635


Why is model-view-controller architecture used in swing?

547






What is the role of java swing?

510


What are the advantage of swing over awt?

505


What is the difference between swing and applet?

550


What is content pane in swing?

525


What are heavy weight components ?

626


What is jfc? What are the features of jfc?

618


What is the use of jfc in java swing?

659


What are the components of swing?

537


Is swing better than awt?

530


Which method of the Component class is used to set the position and size of a component?

568