/* class for simulating an integer memory cell *class intcell public/*construct the intcell initial value is *intcellstoredvalue /*construct the intcell initial value is initialvalue *intcellint initialvalue storedvalue initialvalue/*return the stored value *int readreturn storedvalue/*change the stored value to *void writeint storedvalue xprivateint storedvalue}figure complete declaration of an intcell class extra constructor syntax and accessors although the class works as writtenthere is some extra syntax that makes for better code four changes are shown in figure (we omit comments for brevitythe differences are as followsdefault parameters the intcell constructor illustrates the default parameter as resultthere are still two intcell constructors defined one accepts an initialvalue the other is the zero-parameter