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

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.

thanks Jwenting

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.