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
Can list be null in java?
What is a byte string?
Is oracle charging for java?
What is the use of isempty in java?
Can we override private method?
What do you mean by static variable?
What does string intern() method do?
Why string is called as immutable?
What is thread safe in java?
Why char array is favored over string for the storage of passwords?
What is the difference between checked exception and unchecked exception?
What are java packages?
Why do we use variables?
Can a static class have a constructor java?
Differences between C and Java?