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
In java, how we can disallow serialization of variables?
What is style and indentation?
What is meant by class loader? How many types are there? When will we use them?
How many bytes is a string in java?
How infinite loop is declared?
How do you define a method?
What is the base class for error and exception?
Is binary a low level language?
Can inner class final?
Why heap memory is called heap?
What is a variable in java?
What is procedure overloading?
Describe the Big-O Notation.
Similarity and difference between static block and static method ?
What is a double?