<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                ThinkChat2.0新版上線,更智能更精彩,支持會話、畫圖、視頻、閱讀、搜索等,送10W Token,即刻開啟你的AI之旅 廣告
                ~~~ package io.a8; import java.io.*; public class Test { public static void main(String[] args) { ObjectOutputStream osc = null; ObjectInputStream osr = null; Student ss = new Student("悟空", 007, 95.5f); Student ss2 = null; try { FileOutputStream wsc = new FileOutputStream("e:/ccc.txt"); osc = new ObjectOutputStream(wsc); osc.writeObject(ss); osr = new ObjectInputStream(new FileInputStream("e:/ccc.txt")); ss2 = (Student)osr.readObject(); //readObject()用于讀取數據,并且要進行類型轉換 System.out.println("姓名:"+ss2.xingming); System.out.println("學號:"+ss2.xuehao); System.out.println("成績:"+ss2.chengji); } catch (Exception e) { System.out.println("出現錯誤"); } finally//finally的作用是善后 { try { osc.close(); osr.close(); System.exit(-1); } catch (Exception e) { System.exit(-1); } }//finally下面的try..catch都要寫上起到退出作用的話 }//如果try..catch的后面有finally,那么try..catch不要寫退出程序的代碼 } class Student implements Serializable //接口是空的,起到標準作用 { String xingming = null; int xuehao = 0; transient float chengji = 0; //transient的作用是忽略,外界傳不過來數據 public Student(String xingming, int xuehao, float chengji) { this.xingming=xingming; this.xuehao=xuehao; this.chengji=chengji; } } ~~~ ![](https://box.kancloud.cn/fbffc095b4822b4c7b1a35884904f0fc_196x113.png) 并且e盤中ccc.txt文件顯示 ![](https://box.kancloud.cn/c2bb53612cf0f37c87ab4080a0483538_744x89.png)
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看