+import java.util.*;
-public class Fraccion implements OperFrac, ComparaFrac {
+public class Fraccion extends Observable implements OperFrac, ComparaFrac {
private int num;
private int den;
public void setNum(int n) {
num = n;
+ setChanged ();
+ notifyObservers ();
}
public void setDen(int d) {
den = d;
+ setChanged ();
+ notifyObservers ();
}
public Fraccion() {
int d = mcd(getNum(), getDen());
setNum(getNum() / d);
setDen(getDen() / d);
+ setChanged ();
+ notifyObservers ();
}
}