aspose file tools*
The moose likes Beginning Java and the fly likes private static final long serialVersionUID = 1L; -  Don't exist unique at a class that extends... Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "private static final long serialVersionUID = 1L; -  Don Watch "private static final long serialVersionUID = 1L; -  Don New topic
Author

private static final long serialVersionUID = 1L; - Don't exist unique at a class that extends...

André Asantos
Ranch Hand

Joined: Nov 23, 2009
Posts: 234



Don't exist unique at a class that extends the Serializeble Interface?

Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 40052
    
  28
I don't understand the question. Sorry.
Tanathip Viriya
Greenhorn

Joined: Mar 17, 2010
Posts: 5
I don't understand question too but from

private static final long serialVersionUID = 1L;


this is a default value of serialVersionUID.
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 40052
    
  28
Welcome to the Ranch
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19790
    
  20

Tanathip Viriya wrote:I don't understand question too but from

private static final long serialVersionUID = 1L;


this is a default value of serialVersionUID.

Actually, the default value is calculated automatically. Just try it - create a class without a serialVersionUID field, then run the "serialver" tool with the class name (e.g. serialver Test).

Most IDE's choose to add 1L as the default value but I prefer to let my Eclipse generate it (most likely using serialver).


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
Tanathip Viriya
Greenhorn

Joined: Mar 17, 2010
Posts: 5
Rob Prime wrote:
Tanathip Viriya wrote:I don't understand question too but from

private static final long serialVersionUID = 1L;


this is a default value of serialVersionUID.

Actually, the default value is calculated automatically. Just try it - create a class without a serialVersionUID field, then run the "serialver" tool with the class name (e.g. serialver Test).

Most IDE's choose to add 1L as the default value but I prefer to let my Eclipse generate it (most likely using serialver).


Thank you for clarification.

 
It is sorta covered in the JavaRanch Style Guide.
 
subject: private static final long serialVersionUID = 1L; - Don't exist unique at a class that extends...