Similarity and difference between static block and static method ?
Answer / Vipin Chaudhary
Both static blocks and static methods are related to classes, not objects. They can be accessed before any objects of the class are created. The main difference is that a static block initializes static variables, while a static method performs operations on those variables.
| Is This Answer Correct ? | 0 Yes | 0 No |
How do you convert an int to a string in java?
What is a JAR file?
What is the largest number a double can hold?
What is hard code & soft code?
Is 0 true or false in java?
Can applet in different page/s communicate with each other?
Why are the methods of the math class static?
What is the major drawback of internal iteration over external iteration?
What is literal example?
How do you write methodology?
what is difference between servletconfig and servletcontext?
Explain the scope or life time of class variables or static variables?