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

Answer Posted / anjani kumar jha

Yes We can do..........................there is no problem

static
{
FileSize fz=new FileSize();
System.out.println(fz);
}

Is This Answer Correct ?    9 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

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

520


Why swings are used in java?

527


What are the different types of layout managers used in swing?

524


Which is better swing or awt?

534


What is the difference between swing and applet?

550






What is event in java swing?

516


What are the components of java swing?

526


What is the process of setting the layout manager?

593


Is swing part of core java?

532


What are the components of swing in java?

545


How to create a swing gui in java?

530


What are differences between swing and awt?

528


What is layout in java swing?

534


What is the function of lightweight components used in swing?

560


What is pane in swing?

534