I have a class which implements Serializable. Now I extends this class and I want this extended class to be non Serializable. So how to do it?
For example. I have >
Answering one of your comment (and assuming you are talking of JPA or Hibernate):
But Any class which wants its object to be persisted should implement this. and I want my Class B's objects as non persistable.
If you don't want B to be persistent at all, don't mark it as @Entity
. But it doesn't really make sense for B to extend A if B is not a persistent entity IMHO. This would be a bad use of inheritance.