Java tutorial
import java.io.FileInputStream; public class Main extends FileInputStream { public Main() throws Exception { super("C://test.txt"); } public static void main(String[] args) throws Exception { Main fisa = new Main(); // read byte from file input stream int i = fisa.read(); // converts int to char char c = (char) i; System.out.println(c); // finalize method invoked fisa.finalize(); // method revoked after finalize metod i = fisa.read(); c = (char) i; System.out.println(c); } }