what is the difference between statis block and static
variable
Answer Posted / ramakrishna
Static block is the block which is executed first in the
program. Static variable is the common variable which is
shared by all the objects. Static variable is not specific
to any object.
Is This Answer Correct ? | 11 Yes | 2 No |
Post New Answer View All Answers
I want to persist data of objects for later use. What is the best approach to do so?
how we can create packages in java?
What is visibility mode?
What is the difference between == and === javascript?
What will be the default values of all the elements of an array defined as an instance variable?
What is thread synchronization in java?
What is package private scope in java?
What is nested top-level class?
What is the reflection?
Why do we need data serialization?
What are the java ide’s?
Can you call a method on a null object?
Can you extend main method in java?
What is difference between path and classpath variables?
Explain different ways of creating a thread. Which one would you prefer and why?