title: In Concrete Class my ObjectOutputStream not work not showing correct Result
body: <p>My User Abstract class</p>
  
  <pre><code>package mainpkg;
  
  abstract public class User {
      public int id;            
      public String name, email, mobile;     
  
      public User() {
      }
  
      public User(int id, String name, String email, String mobile) {
          this.id = id;
          this.name = name;
          this.email = email;
          this.mobile = mobile;
      }
  
      abstract public void setInfo();       
      abstract public void showInfo(); 
  }
  </code></pre>
  
  <p>And This is my Student Concreate Class</p>
  
  <pre><code>package mainpkg;
  
  import java.io.Serializable;
  import java.util.Scanner;
  
  public class Student extends User implements Serializable  {
      private float cgpa;
      private String dept;
  
  
      public Student(float cgpa, String dept, int id, String name, String email, String mobile) {
          super(id, name, email, mobile);
          this.cgpa = cgpa;
          this.dept = dept;
      }
  
      @Override
      public void setInfo() {
          System.out.println("Set Student Info");
          Scanner s = new Scanner(System.in);
  
          System.out.print("Enter ID: "); id = s.nextInt();
          s.nextLine();
          System.out.print("Enter Name: "); name = s.nextLine();
          System.out.print("Enter Email: "); email = s.nextLine();
          System.out.print("Enter Mobile: "); mobile = s.nextLine();
          System.out.print("Enter dept: "); dept = s.nextLine();
          System.out.print("Enter CGPA: "); cgpa = s.nextFloat();
      }
  
      @Override
      public void showInfo() {
          display();
      }
  
      public void display(){
          System.out.println("ID : "+id+", Name : "+name+", email : "+email+", mobile : "+mobile+", CGPA : "+cgpa+", dept : "+dept+";");
      }
  
      @Override
      public String toString() {
          return "ID : "+id+", Name : "+name+", email : "+email+", mobile : "+mobile+", CGPA : "+cgpa+", dept : "+dept+";\n";
          }
  }
  </code></pre>
  
  <p>This is the code, What show me, My result</p>
  
  <pre><code>@FXML
      private void showStudentButtonOnclick(ActionEvent event) {
          FileInputStream fis = null;
          ObjectInputStream ois = null;
          try {
               File f = new File("student.bin");
              if(!f.exists())
                  outputTextFeild.setText("File Does Not Exists!!");
  
              else {
                  fis = new FileInputStream(f);
                  ois = new ObjectInputStream(fis);
                  outputTextFeild.setText("");
  
              try{
  //                    Student s;
                      while(true){
                         Student s = (Student) ois.readObject();
                          System.out.println(s.toString());
                          outputTextFeild.appendText(s.toString());
                      }
              } catch (Exception ex){
                      System.out.println(ex);
                  }
              }
  
          } catch (IOException ex) {
  //            Logger.getLogger(FXMLMainSceneController.class.getName()).log(Level.SEVERE, null, ex);
              System.out.println(ex);
          }
  
          finally{
              if(ois != null)
              try{
                   ois.close();
              } catch (IOException ex){
              System.out.println(ex);
          }
          }
  
      }
  </code></pre>
  
  <p>But This is actully it returns </p>
  
  <p>ID : 0, Name : null, email : null, mobile : null, CGPA : 2.6, dept : cse;</p>
  
  <p>ID : 0, Name : null, email : null, mobile : null, CGPA : 2.7, dept : bba;</p>
  
  <p>They cannt return my super class data.
  Pls help me. Thank You.</p>