my dog learned polymorphism
The moose likes Beginning Java and the fly likes extending class with serialVersionUID Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Building Microservices this week in the Design forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "extending class with serialVersionUID " Watch "extending class with serialVersionUID " New topic

extending class with serialVersionUID

jacob deiter
Ranch Hand

Joined: Apr 02, 2008
Posts: 580

here ,if I use class B then its serialversionis used ,what will happen for class A serialversionId?

Paul Clapham

Joined: Oct 14, 2005
Posts: 19728

It follows the same rule as for any other static variable.
Henry Wong

Joined: Sep 28, 2004
Posts: 20057

Side issue: In this example, neither class is serializable, so the serial version uid won't be used -- at least, not by the Java serialization mechanism.


Books: Java Threads, 3rd Edition, Jini in a Nutshell, and Java Gems (contributor)
I agree. Here's the link:
subject: extending class with serialVersionUID
It's not a secret anymore!