Non static block / Instance Initialiser block / Anonymous block  
Any block declared inside global area not prefix with static keyword is known as non static block.

Characteristics of non static block 
  1. non static block doesn't have any name.
  2. non  static block doesn't have any formal arguments.
  3. non  static block doesn't have any return type.
  4. non static block executed automatically (implicitly) by the compiler.
  5. Programmer can not call non static block.

Ex.
  1. class Instagram
  2. {
  3. public static void main(String [ ] args)
  4. {
  5. Instagram ref1 = new Instagram( );
  6. Instagram ref2 = new Instagram( );
  7. Instagram ref3 = new Instagram( );
  8. System.out.println(("ME");
  9. }
  10. {
  11. System.out.println(("Congratulations your a/c has been created successfully..!");
  12. }
  13. }  Congratulations your a/c has been created successfully..!
Output:
Congratulations your a/c has been created successfully..!       
Congratulations your a/c has been created successfully..!    
Congratulations your a/c has been created successfully..!    
                                                                                                               

Tracing 



Note: 
non static block gets executed only when we create object but only once.


why do we need non static block?  
To execute some statements mandatorily whenever we create object.


Difference between static and Non static block:

Sr. No

Static block

Non static block

1.

Any block declared inside global area prefix with static keyword

block declared inside global area not prefix with static keyword.

2.

static block execute before main method.

non staic block execute after main method.

3.

Object creation is not mandatory.

Object creation is compulsary.

4.

To execute some statements before execution of main method.

To executes some statements mandatory.