Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

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

 
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
Posts: 53773
128
  • 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
Posts: 53773
128
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the Ranch
 
Rob Spoor
Sheriff
Posts: 20895
81
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.

 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!