Can someone tell me what is the purpose of the block in the middle of the main method ? what do you call such action ?
public class test { private static int i = 0; private static int j = 0; public static void main(String[] args) { int i = 2; int k = 3; { int j = 3; System.out.println("i + j is " + i + j); } k = i + j; System.out.println("k is " + k); System.out.println("j is " + j); } }
like i can tell by running the code but what is its purpose and what do you call it.