方法:
public class ctryob extends Observable
{
static class C1 extends Observable
{
int i=0;
public void setChanged(){
super.setChanged();
System.out.println(i);
}
}
}
测试:
public class test {
public static void main(String[] args)
{
C1 ce=new C1();
ce.i=1;
ce.i=5;
ce.setChanged();
ce.notifyObservers();
}
}