Having difficulties getting console output Followed this youtube tutorial: https://www.youtube.com/watch?v=DfbFTVNfkeI and got exception error while trying to run  ===================================================================== package Deserialization; import java.io.*;  public class Main {     public static void main(String[] args) throws IOException, ClassNotFoundException {  // Deserialization = The reverse of converting a byte stream into an object.  // (Thin of this as if you are loading a saved file)  // steps to Deserialize  // -----------------------------------------------------------------  // 1. Declare your object (don't instantiate)  // 2. Your class should implement Serializable interface  // 3. Add import java.io.Serializable;  // 4. FileInputStream fileIn = new FileInputStream(file path);  // 5. ObjectInputStream in = new ObjectInputStream(fileIn);  // 6. objectNam = (Class) in.readObject();  // 7. in.close(); fileIn.close();  // ------------------------------------------------------------------  // important notes    1. children classes of a parent class that implements Serializable will do so as well  // 2. static fields are not serialized (they belong to the class, not an individual object)  // 3. Fields declared as "transient" aren't serialized, they're ignored  // 4. the class's definition ("class file") itself is not recorded, cast it as the object type  // 5. serialVersionUID is a unique version ID  User user = null;  FileInputStream fileIn = new FileInputStream("C:\\Users\\mckun\\eclipse-workspace\\Serializer\\UserInfo.ser");  ObjectInputStream in = new ObjectInputStream(fileIn);  user = (User) in.readObject();  in.close();  fileIn.close();  System.out.println(user.name);  System.out.println(user.password);  user.sayHello();     } } ======================================================================== package Deserialization; import java.io.Serializable; public class User implements Serializable{          String name;     String password;          public void sayHello() {  System.out.println("Hello "+ name);     } }

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

Having difficulties getting console output

Followed this youtube tutorial: https://www.youtube.com/watch?v=DfbFTVNfkeI

and got exception error while trying to run 

=====================================================================

package Deserialization;
import java.io.*;
 public class Main {
    public static void main(String[] args) throws IOException, ClassNotFoundException {
 // Deserialization = The reverse of converting a byte stream into an object.
 // (Thin of this as if you are loading a saved file)
 // steps to Deserialize
 // -----------------------------------------------------------------
 // 1. Declare your object (don't instantiate)
 // 2. Your class should implement Serializable interface
 // 3. Add import java.io.Serializable;
 // 4. FileInputStream fileIn = new FileInputStream(file path);
 // 5. ObjectInputStream in = new ObjectInputStream(fileIn);
 // 6. objectNam = (Class) in.readObject();
 // 7. in.close(); fileIn.close();
 // ------------------------------------------------------------------
 // important notes    1. children classes of a parent class that implements Serializable will do so as well
 // 2. static fields are not serialized (they belong to the class, not an individual object)
 // 3. Fields declared as "transient" aren't serialized, they're ignored
 // 4. the class's definition ("class file") itself is not recorded, cast it as the object type
 // 5. serialVersionUID is a unique version ID
 User user = null;
 FileInputStream fileIn = new FileInputStream("C:\\Users\\mckun\\eclipse-workspace\\Serializer\\UserInfo.ser");
 ObjectInputStream in = new ObjectInputStream(fileIn);
 user = (User) in.readObject();
 in.close();
 fileIn.close();
 System.out.println(user.name);
 System.out.println(user.password);
 user.sayHello();
    }
}

========================================================================

package Deserialization;
import java.io.Serializable;
public class User implements Serializable{
    
    String name;
    String password;
    
    public void sayHello() {
 System.out.println("Hello "+ name);
    }
}

Expert Solution
steps

Step by step

Solved in 3 steps with 3 images

Blurred answer
Knowledge Booster
Linux
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education