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
Explain the difference between an Interface and an Abstract class?
What are synchronized blocks in java?
What is the difference between call by reference and call by pointer?
What are the object and class classes used for?
How do you compare arrays in java?
What is off heap memory?
What is the difference between multiple processes and multiple threads?
What is anagram in java?
How does linkedhashmap work in java?
How to instantiate member inner class?
What is constructor and virtual function? Can we call a virtual function in a constructor?
Explain the advantages of packages in java?
What is immutable in java?
What is array length?
What is defined as false sharing in the context of multithreading?