IntCell - { storedValue = initialValue; } /** * Get the...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
/** * A class for simulating an integer memory cell. * @author Mark A. Weiss */ public class IntCell { /** * Construct the IntCell. * Initial value is 0. */ public IntCell( ) { this( 0 ); } /** * Construct the IntCell. * @param initialValue the initial value. */ public IntCell( int initialValue )
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: { storedValue = initialValue; } /** * Get the stored value. * @return the stored value. */ public int read( ) { return storedValue; } /** * Store a value * @param x the number to store. */ public void write( int x ) { storedValue = x; } private int storedValue; }...
View Full Document

This document was uploaded on 06/13/2011.

Ask a homework question - tutors are online