A
alex
Hi,
I have the following problem:
I have a base class Foo
public class Foo implements Serializable {
public int a = 0;
public void setA() { a = 1;}
}
when I try to serialize the instance of the class I have no problem:
Foo of = new Foo();
new ObjectOutputStream(new ByteArrayOutputStream()).writeObject(of);
however, when I dynamically extend Foo I'm getting
NotSerializableException:
Foo of = new Foo() {
public void setA() { a = 2;}
};
new ObjectOutputStream(new ByteArrayOutputStream()).writeObject(of);
NotSerializableException thrown....
I'd appreciate any idea on how to solve this problem
Thanks,
-Alex
I have the following problem:
I have a base class Foo
public class Foo implements Serializable {
public int a = 0;
public void setA() { a = 1;}
}
when I try to serialize the instance of the class I have no problem:
Foo of = new Foo();
new ObjectOutputStream(new ByteArrayOutputStream()).writeObject(of);
however, when I dynamically extend Foo I'm getting
NotSerializableException:
Foo of = new Foo() {
public void setA() { a = 2;}
};
new ObjectOutputStream(new ByteArrayOutputStream()).writeObject(of);
NotSerializableException thrown....
I'd appreciate any idea on how to solve this problem
Thanks,
-Alex