1. import java.io.*;2. class Food {Food() { System.out.print("1"); } }3. class Fruit extends Food implements Serializable {4. Fruit() { System.out.print("2"); } }5. public class Banana2 extends Fruit { int size = 42;6. public static void main(String [] args) {7. Banana2 b = new Banana2();8. b.serializeBanana2(b); /* assume correct serialization*/9. b = b.deserializeBanana2(b); /* assume correct*/10. System.out.println(" restored " + b.size + " "); }11. /* more Banana2 methods*/12. }