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
Is a class subclass of itself?
What is meant by javabeans?
What will happen if static modifier is removed from the signature of the main method?
What is keyset in java?
What is module in project?
How do you get length in java?
What classes of exceptions may be caught by a catch clause in java programming?
Write a program to find the whether a number is an Armstrong number or not?
What is the difference between normal report & matrix report?
How does indexof work?
What is empty string literal in java?
Why is the main method declared static?
What is command line used for?
Can I override protected method in java?
Can we use static class instead of singleton?