Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

Java design patterns

public class BinaryObserver extends Observer{

   public BinaryObserver(Subject subject){
      this.subject = subject;
      this.subject.attach(this);
   }

   @Override
   public void update() {
      System.out.println( "Binary String: " + Integer.toBinaryString( subject.getState() ) ); 
   }
}
Source by www.tutorialspoint.com #
 
PREVIOUS NEXT
Tagged: #Java #design #patterns
ADD COMMENT
Topic
Name
7+5 =