why do we use instance block in java code example
Example 1: instance block in java
Instance Block
Executes in each object creation.
Constructor is executed even if
you don't create one, compiler does it
but initially, you have to declare it.
Example 2: what is instance block in java
Instance Block
Executes in each object creation.
Constructor is executed even if
you don't create one, compiler does it
but initially, you have to declare it.