This week's book giveaway is in the JavaFX forum.
We're giving away four copies of Introducing JavaFX 8 Programming and have Herbert Schildt on-line!
See this thread for details.
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 Introducing JavaFX 8 Programming this week in the JavaFX 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: 19739

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

Joined: Sep 28, 2004
Posts: 20133

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!