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
What are the swing components?
What is the difference between swing and awt?
Where is java swing used?
What are heavyweight components? What is lightweight component?
Which containers use a border Layout as their default layout in swing?
What is the use of java swing?
What is java awt and swing?
What are the swing components in java?
What class is at the top of the AWT event hierarchy?
What is the difference between invokeAndWait() and invokeLater()?
Who created the swing?
What are the advantage of swing over awt?
Can a class be it?s own event handler? Explain how to implement this?
What is a component in swing?
What is java swing gui?