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
What is keyword and identifier?
If we don’t want some of the fields not to serialize how to do that?
How do you declare a destructor in java?
Explain exception chaining in java?
What class allows you to read objects directly from a stream?
What happens if an exception is throws from an object's constructor?
What is public static?
What is the purpose of nested class in java?
Can we overload run() method in java?
What is a method in coding?
What is thread pool in java with example?
What is Session reduplication and how its done?
Can constructor be synchronized?
What is purpose of keyword void?
How do you convert bytes to character in java?