Question: what is difference between static block and constructor?
Answer: static block is executed at compile time itself where as constructor is executed just before the creation of object that is after run time of program. 3. Static block is executed only once during the lifetime of program where as constructor is executed each time a new object is created.