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
Can we pass a primitive type by reference in java? How
Is null keyword in java?
What is the syntax and characteristics of a lambda expression? Explain
What is the difference between superclass and subclass?
What is a predicate method?
Why main function is static?
How is it possible in java programming for two string objects with identical values not to be equal under the == operator?
If I don't provide any arguments on the command line, then what will the value stored in the string array passed into the main() method, empty or null?
How do you sort objects in java?
Why is multiple inheritance not supported in java?
What are the important features of Java 8 release?
What are the advantages of encapsulation in java?
What does method mean?
Why do we need array in java?
what is meant by HQL?