what is the difference between static block and static
method
Answer Posted / navaneesh
i think static block is executed, when the class is
loaded.That means at the time of compile time.so that
block sill executed first.
where as static method have to call seperately and also it
can call with out object instance.so it executed when run time.
Is This Answer Correct ? | 56 Yes | 20 No |
Post New Answer View All Answers
What is a boolean structure?
Why java is not 100% object-oriented?
Can a abstract class be declared final?
Is minecraft 1.15 out?
What are the advantages of java over C++?
Which variable is the independent variable?
Can we have multiple classes in single file ?
Is vector thread safe in java?
What is singletonlist in java?
Can a class be private in java?
Differentiate between postfix and prefix operators in java.
How do you reverse a string in java without using string buffer?
Explain polymorphism citing an example.
Does java isempty check for null?
What is the common usage of serialization?