相关代码 |
|
package test6; import java.util.Observer; import java.util.Observable; public class NameObserver implements Observer { private String name = null; public void update(Observable obj, Object arg) { if (arg instanceof String) { System.out.println("NameObserver :name changet to " + (String)arg); } } }
相关资源 |
|