what is the difference between static block and static
method
Answer Posted / himanshu kumar upadhyay
Static block is executed when the class which contain static
block is loaded in to memory and static method is executed
when it is called. Mostly static block is used for
Initialization of static members.
| Is This Answer Correct ? | 17 Yes | 2 No |
Post New Answer View All Answers
Why can we not override static method?
What access modifiers can be used for variables?
What is yield () in java?
Explain different ways of creating a thread?
Explain super keyword in java.
What is OOP's Terms with explanation?
What do you mean by data type?
What is a qms manual?
Does java have extension methods?
Difference between nested and inner classes ?
Explain about join() method?
What are the drawbacks of singleton class?
What is downcasting?
Why java uses the concept of the string literal?
What is scope & storage allocation of static, local and register variables? Explain with an example.