class BoxingDemo { public static void main( String [] args) { GenericMemoryCell m = new GenericMemoryCell (); m.write(37); int val = m.read(); System.out.println( "Contents are: " + val ); GenericMemoryCell s = new GenericMemoryCell (); s.write("John"); String s1 = s.read(); System.out.println( "Contents are: " + s1 ); } } class GenericMemoryCell { public AnyType read() { return storedValue;} public void write( AnyType x) { storedValue = x; } private AnyType storedValue; }