Best way to mark an inherited class as NOT serializable

Posted by initialZero on Stack Overflow See other posts from Stack Overflow or by initialZero
Published on 2010-03-12T22:53:23Z Indexed on 2010/03/12 22:57 UTC
Read the original article Hit count: 333

Filed under:

If I inherit from a class that is serializable but I specifically do not want my class to be serializable; what's the best way to strictly prevent serialization?

If there was a method in java.io.Serializable maybe I could throw an exception, but Serializable is empty.

© Stack Overflow or respective owner

Related posts about java