Reputation: 3699
What would prevent a class from being serializable?
I understand that a class is not serializable by default because enabling serialization introduces overhead. But are there characteristics of certain classes that would prevent them from being serialized?
If it's relevant, I am specifically thinking about XML serialization.
Upvotes: 2
Views: 227
Reputation: 838276
There are objects which can't be serialized. If the object contains handles to external resources then these often cannot be serialized in a meaningful way.
Examples:
Upvotes: 7