//file: Person.java // Example // Ibrahim Matta, Sep 28, 1999 // For use with the file Proj2.java, in this directory import java.util.*; class Person implements Runnable { private Bridges river; private int direction; /** Constructor */ Person(Bridges river, int direction) { this.river = river; this.direction = direction; } /** run */ public void run() { try { if(direction == Bridges.GOEAST) { river.cross(0, direction); } else { river.cross(1, direction); } } catch( Drowning e) { pl( "Sorry, he drowned." ); } } static private void pl(String msg) { System.out.println(msg); } }