package cell;

public class MemoryCell {
    public Object read(){ return storedValue; }
    public void write( Object x ) { storedValue = x; }
    private Object storedValue;
    
    public static void main(String[] args) {
        MemoryCell m = new MemoryCell();
        
        m.write(4);
        System.out.println(m.read());
        
        m.write(new Double(5.5));
        System.out.println(m.read());
        
        m.write(new String("Now, let's write a String to the cell."));
        System.out.println(m.read());
        
    }
}