// MVCProg uses addObserver to register tViewOne as a viewer of tModel. // Barry Cornelius, 19 June 2000 import java.io. BufferedReader; import java.io. InputStreamReader; import java.io. IOException; public class MVCProg { public static void main(final String[] pArgs) throws IOException { final Model tModel = new Model(); final ViewOne tViewOne = new ViewOne(); tModel.addObserver(tViewOne); final BufferedReader tKeyboard = new BufferedReader(new InputStreamReader(System.in)); while (true) { System.out.print("Type in an int: "); System.out.flush(); final String tLine = tKeyboard.readLine(); if (tLine.equals("")) { break; } final int tNewValue = Integer.parseInt(tLine); tModel.set(tNewValue); } } }