@@ -0,0 +1,1314 @@
+import java.io.ByteArrayInputStream;%0Aimport java.io.ByteArrayOutputStream;%0Aimport java.io.ObjectInputStream;%0Aimport java.io.ObjectOutputStream;%0Aimport java.io.Serializable;%0A%0Apublic class TransientFieldOfNonserializableClass %7B%0A%09transient public int super_test = 1;%0A%0A%09public void setTest(int t) %7B%0A%09%09super_test = t;%0A%09%7D%0A%0A%0A static class Sub extends TransientFieldOfNonserializableClass implements Serializable %7B%0A%09public int sub_test = 2;%0A%0A%09public static void main(String%5B%5D args) %7B%0A%09%09try %7B%0A%09%09%09ByteArrayOutputStream baos = new ByteArrayOutputStream();%0A%09%09%09ObjectOutputStream oos = new ObjectOutputStream(baos);%0A%09%09%09Sub s = new Sub();%0A%09%09%09s.setTest(99);%0A%09%09%09s.sub_test = 98;%0A%09%09%09oos.writeObject(s);%0A%09%09%09oos.flush();%0A%09%09%09byte%5B%5D data = baos.toByteArray();%0A%09%09%09ByteArrayInputStream bais = new ByteArrayInputStream(data);%0A%09%09%09ObjectInputStream ois = new ObjectInputStream(bais);%0A%09%09%09s = (Sub)ois.readObject();%0A%09%09%09if (s.super_test == 99)%0A%09%09%09%09System.out.println(%22Super class data serialized%22);%0A%09%09%09else if (s.super_test == 1)%0A%09%09%09%09System.out.println(%22Super class data initialized in constructor%22);%0A%09%09%09if (s.sub_test == 98)%0A%09%09%09%09System.out.println(%22Sub class data serialized%22);%0A%09%09%09else if (s.super_test == 2)%0A%09%09%09%09System.out.println(%22Sub class data initialized in constructor%22);%0A%0A%09%09%7D catch (Exception e) %7B%0A%09%09%09e.printStackTrace();%0A%09%09%7D%0A%09%7D%0A%7D%0A%0A%0A%0A%7D

Add test case for transient field of nonserializable class