// Project: Observer // Module: messageboard Example // Source code file Student.java // Illustrate the Observer software pattern. // Student is the observer; // MessageBoard is the observable. import it313.util.*; public class Student implements Observer { private String name; public Student(String theName) { name = theName; } // This update method is required by the // Observer interface. It is automatically // called by the notifyObservers method of the // Observable class. public void update(Observable obs, Object info) { System.out.println("Student Name: " + name); System.out.println("Message board changed."); System.out.println("New message: " + info); System.out.println( ); } }