@@ -0,0 +1,554 @@
+// Use a static block%0Aclass StaticBlock %7B%0A  static double rootOf2;%0A  static double rootOf3;%0A  %0A  static %7B%0A    System.out.println(%22Inside static block.%22);%0A    rootOf2 = Math.sqrt(2.0);%0A    rootOf3 = Math.sqrt(3.0);%0A  %7D%0A  %0A  StaticBlock(String msg) %7B%0A    System.out.println(msg);%0A  %7D%0A%7D%0A%0Aclass SDemo3 %7B%0A  public static void main(String args%5B%5D) %7B%0A    StaticBlock ob = new StaticBlock(%22Inside Constructor%22);%0A    %0A    System.out.println(%22Square root of 2 is %22 + StaticBlock.rootOf2);%0A    System.out.println(%22Square root of 3 is %22 + StaticBlock.rootOf3);%0A  %7D%0A%7D%0A

Use a static block