^_^.这样改一下就可以了!
class Book {
  boolean checkedOut=false ;
  
  Book(boolean checkOut) {
    checkedOut = checkOut;
  }  void checkIn() {
    checkedOut = false;
  }  public void finalize() {
    if(checkedOut)
      System.out.println("Error: checked out"); 
   }
 }public class TerminationCondition { 
  public static void main(String[] args) {
    Book novel=new Book(true); 
    novel=null;
    System.gc();
   } 
 }