//package Posmatrac; import java.util.*; // "Subject" abstract class Stock { // polja protected String symbol; protected double price; private ArrayList investors = new ArrayList(); // konstruktor public Stock( String symbol, double price ) { this.symbol = symbol; this.price = price; } // metodi public void Attach( Investor investor ) { investors.add( investor ); } public void Detach( Investor investor ) { investors.remove( investor ); } public void Notify() { for( int i=0; i