Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
André Asantos
Ranch Hand
Posts: 234
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator



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

 
Campbell Ritchie
Sheriff
Pie
Posts: 48972
60
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't understand the question. Sorry.
 
Tanathip Viriya
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't understand question too but from

private static final long serialVersionUID = 1L;


this is a default value of serialVersionUID.
 
Campbell Ritchie
Sheriff
Pie
Posts: 48972
60
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the Ranch
 
Rob Spoor
Sheriff
Pie
Posts: 20532
54
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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).
 
Tanathip Viriya
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic