what is the difference between statis block and static
variable
Answer Posted / ravikiran
static block is used to initialize the variables during the
Jvm start up.
static variable is used to declare the class level
variables whose value remains ame for the whole class.
Is This Answer Correct ? | 1 Yes | 4 No |
Post New Answer View All Answers
Is ++ operator thread-safe in java?
How do you check if a string is lexicographically in java?
Can you override a final method?
What is class forname used for?
Which command from the jdk compiles a java program?
If an object reference is set to null, will the garbage collector immediately free the memory held by that object?
What is data type in java?
Can we use a default constructor of a class even if an explicit constructor is defined?
Why do we need variables?
Are arrays immutable in java?
Is an object null?
What is starvation?
what is thread in Java ?
What is java and why do we need it? Explain
If goto and const is reserve words than why it is not work in java?