/** * This class just holds an int. It illustrates how we could write * our own "wrapper class" that could be contained within an ArrayList. * (We can't store primitive types like int, but we could make an * ArrayList of JustAnInt items, each of which "wraps up" an integer.) * * Java has a built-in wrapper class, Integer, so we don't have to use * this one. */ public class JustAnInt { private int n; // The value stored in this object /** * Constructor for objects of class JustAnInt */ public JustAnInt(int theInt) { n = theInt; } public int getValue() { return n; } public void setValue(int theInt) { n = theInt; } }