このプログラムでは、3 番目の文字列は表示されません。なんで?
(この Java プログラムは、Ubuntu 10.10 上の Eclipse Indigo で実行されました。)
import java.io.PrintWriter;
public class Tester
{
static void nested()
{
PrintWriter object2 = new PrintWriter(System.out, true);
object2.println("second");
object2.close(); // delete this line to make all strings print
}
public static void main(String[] args)
{
PrintWriter object1 = new PrintWriter(System.out, true);
object1.println("first");
Tester.nested();
object1.println("third");
object1.close();
}
}