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 is difference between awt and swing?
What is the purpose of action interface in swing?
Which method of the Component class is used to set the position and size of a component?
Why swing is better than awt?
Why swings are used in java?
Who created the swing?
Which layout does swing use by default?
Is swing part of core java?
What is swing gui in java?
Is java swing a framework?
What are the swing components?
Why swing components are called lightweight components?
What are swing components?
Which swing methods are thread-safe?
What is java swing gui?