Category: Implications for Nested Classes

  • Recursive Type Bounds Revisited – Generics

    Recursive Type Bounds Revisited The class MonoNode and the interface IMonoLink<E> are declared in Example 11.3, p. 572, and the class BiNode and the interface IBilink<E> are declared in Example 11.5, p. 574. See also Figure 11.1, p. 574. Click here to view code image class MonoNode<E> implements IMonoLink<E> { …

  • Modifying Capacity – Collections, Part I: ArrayList

    Modifying Capacity The following two methods can be used to modify the capacity of a list. There is no method that returns the current capacity of an ArrayList<E>. void trimToSize() Trims the capacity of this list to its current size. Click here to view code image void ensureCapacity(int minCapacity)                From List<E>interface. Ensures…