/************************************************** * Author: Morrison * Date: 01 Apr 202022 **************************************************/ public class BlockHead { public static final int IQ; static { IQ = 6; //Outside this is BlockHead.IQ } private int quack; //visible inside class but not out public BlockHead(int quack) { this.quack = quack; } public int foo(int x) //this x is private to foo { return x*quack; } public static void main(String[] args) { int x = 15; //this variable is visible anywhere int y = 0; if(x > 10) //in main. { y = 4; //this variable dies at the } //end of this block else { y = 2; } } }