Java Reference
In-Depth Information
} catch (Exception e) {
throw new IllegalArgumentException(e);
}
}
}
class Super implements Serializable {
final Set<Super> set = new HashSet<Super>();
}
final class Sub extends Super {
private int id;
public Sub(int id) {
this.id = id;
set.add(this); // Establish invariant
}
public void checkInvariant() {
if (!set.contains(this))
throw new AssertionError("invariant violated");
}
public int hashCode() {
 
 
Search WWH ::




Custom Search