Java examples for Object Oriented Design:Class
An Example of a Mutable Class Whose Object's State Can Be Changed After Creation
public class IntHolder { private int value; //from w w w . j a v a 2s .c o m public IntHolder(int value) { this.value = value; } public void setValue(int value) { this.value = value; } public int getValue() { return value; } }