0

Hi All,

Good Day

I need some clarification , When serializing the inner class alone(implements Serializable only for inner class) I am getting java.io.NotSerializableException: SerializeinnerClass. At the same time when I am serializing static inner class I am not getting that exception.
can any one explain me.

Thanks in advance
-Anand

2
Contributors
2
Replies
11
Views
1 Year
Discussion Span
Last Post by anand01
3

an instance of an inner class exists only within the context of an instance of its outer class, UNLESS it's static.
Result is that an inner class of a non-serializable outer class is not serializable, even if it is marked as serializable itself.

Edited by jwenting

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.