A static block is a normal block of code enclosed in braces, { }, and preceded by the static keyword.
Questions tagged [static-block]
166 questions
-7
votes
1 answer
Why static blocks get executed two times while here is only one class file in this code?
FYI - Here is only one class file FirstDup.
Question-
As we know that static block get executed only once when class is loaded in JVM. So my point is.. when I start the execution of class by giving the command "java FirstDup" then class is loading…

Rani
- 1