From Thinking in Java 4th Edition 持有对象 // Simple container example (produces compiler warnings.) // {ThrowsException} import java.util.*; class Apple { private static long counter; private final long id = counter++; public long id() { return id;} } c…