为什么我把流对象放在倒数第二行关闭这个程序就无法运行了,另外我还想请教各位高手即使放对了地方,但是运行之后为什么不能退出这个程序?拜托了/**
   编写一个图形界面,使用户可以输入
   学生姓名,性别,年龄,并把这些信
   息写入到当前目录下的myBook.dat文件下
*/import java.io.*;
import javax.swing.*;public class StudentInfo
{
  public static void main(String[] args) throws IOException
  {
    FileOutputStream fos = new FileOutputStream("myBook.dat");
    BufferedOutputStream bos = new BufferedOutputStream(fos);
    DataOutputStream dos = new DataOutputStream(bos);
    JFrame frame = new JFrame();
    frame.setVisible(true);
    String name = JOptionPane.showInputDialog(frame, "Your name?");
    dos.writeUTF(name);
    String sex = JOptionPane.showInputDialog(frame, "Your sex?");
    dos.writeUTF(sex);
    int age = Integer.parseInt(JOptionPane.showInputDialog(frame, "Your age?"));
    dos.writeInt(age);
    dos.close();  //  !!!!!!!!!!
    FileInputStream fis = new FileInputStream("myBook.dat");
    BufferedInputStream bis = new BufferedInputStream(fis);
    DataInputStream dis = new DataInputStream(bis);
    System.out.println("name: " + dis.readUTF());
    System.out.println("sex: " + dis.readUTF());
    System.out.println("age: " + dis.readInt());
    // !!!!!
    dis.close();
  }
}