title: define a class as Observable and Observer both
body: <p>technically it seems OK to define a <code>Class</code> as both <code>Observable</code> and <code>Observer</code> using the following code:</p>
  
  <pre><code>public class Data extends Observable implements Observer
  </code></pre>
  
  <p>however, trying to implement it, it's not working. </p>
  
  <pre><code>public class Data extends Observable implements Observer {
  
      @Override
      public void update(Observable o, Object o1) {
          System.out.println("SC");        
      }
  
      Integer A;
      String B;
      Float C;
  
      public Data() {
          this.addObserver(this);
      }
  
      public void setA(Integer A) {
          this.A = A;
          notifyObservers();
      }
  
      public void setB(String B) {
          this.B = B;
          notifyObservers();
      }
  
      public void setC(Float C) {
          this.C = C;
          notifyObservers(this.C);
      }
  
  }
  </code></pre>
  
  <p>with the <code>main</code> function as below:</p>
  
  <pre><code>public static void main(String[] args) {
      Data d = new Data();
      d.setA(5);
      d.setB("Hi");
      d.setC(2.0f);
  }
  </code></pre>
  
  <p>it should prints some "SC" but it's not working. Can anyone describes why?</p>