Page 505: Program 21.1 doesn't work because Java doesn't allow subclasses to restrict return types. However, you can still limit a stack to jsut strings like this:
public class StringStack extends java.util.Stack {
public Object push(Object item)
super.push((String) item);
}
}
Page 510: the first code fragment on the page should read
for (Enumeration e = ht.elements(); e.hasMoreElements(); ) {
System.out.println(e.nextElement());
}