File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "extending class with serialVersionUID " Watch "extending class with serialVersionUID " New topic
Author

extending class with serialVersionUID

jacob deiter
Ranch Hand

Joined: Apr 02, 2008
Posts: 576

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

Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18541
    
    8

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

Joined: Sep 28, 2004
Posts: 18529
    
  40


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.

Henry


Books: Java Threads, 3rd Edition, Jini in a Nutshell, and Java Gems (contributor)
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: extending class with serialVersionUID
 
Similar Threads
eclipse 3.1, java 5
ArrayList problem ...
About serialVersionUID
private static final long serialVersionUID = 1L; - Don't exist unique at a class that extends...
sending org.jdom.Document object over JMS