public class Scope { public static void main(String[] args) { int x = 1; System.out.println("S1 for x: "+x); { System.out.println("S2 for x (before changing): "+x); x = x + 1; System.out.println("S2 for x (after changing): "+x); int y = 3; { System.out.println("S3: "+(x + y)); } } String y = "yes, this is legal"; System.out.println("S1: "+y); } }