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 are the swing components in java?

503


What is the role of java swing?

506


What is content pane in swing?

521


What do you mean by java swing?

512


Why would you use swingutilities.invokeandwait or swingutilities.invokelater?

552






What are swings?

515


Where is java swing used?

580


What is the mean of swing?

498


Explain the difference between awt and swt.

549


What are the differences between Swing and AWT?

569


What are heavyweight components? What is lightweight component?

530


What is the function of lightweight components used in swing?

554


What is swing used for?

489


What is swing in java with example?

506


What is jpanel in java swing with example?

505