Serialization in A IS-A relationship

 

import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.ObjectInputStream;
import java.io.ObjectOutput;
import java.io.ObjectOutputStream;

public class SerilizableISA {

public static void main(String[] args) {
System.out.println("==========Serilization Started============");
try {
//creating object of Student class
Student1 s1 = new Student1(123, "Vijay Dehraj", "Java", 50000);
//creating stream to write data into the file
FileOutputStream fos = new FileOutputStream("inheritance.txt");
ObjectOutputStream out = new ObjectOutputStream(fos);
out.writeObject(s1);
//closing the stream
out.close();
System.out.println("The state of object is saved");
System.out.println("==========Serilization Ended==============");
} catch (Exception e) {
e.printStackTrace();
}
System.out.println("==========Deserilization Started==========");
try {
//creating input stream to read the data of serialized object
ObjectInputStream ois = new ObjectInputStream(
new FileInputStream("inheritance.txt")
);
Student1 s = (Student1) ois.readObject();
//printing data of serialized object
System.out.println(s.id + " " + s.name + " " + s.course + " " + s.fee);
System.out.println("==========Deserilization Started==========");
} catch (Exception e) {
System.out.println(e);
}
}
}

Google Script for Data Entry Form in Google Spreadsheet

// function to validate the entry made by user in user form function validateEntry (){ // declare a variable and referernece of active goog...