令我有些吃惊的是,以下代码打印了两次“Close”。通过调试器运行,似乎MyPrintStream.close()调用了super.close(),最终再次调用了MyPrintStream.close().importjava.io.*;publicclassPrintTest{staticclassMyPrintStreamextendsPrintStream{MyPrintStream(OutputStreamos){super(os);}@Overridepublicvoidclose(){System.out.println("Close");super.close();}}p