Serialization and serialVerUID

M

Murray

I know that if you're using Serialization, it's best to specify a
serialVersionUID in your class to aid version tracking/maintenance. If your
class has several inner classes, do each of these also need their own
serialVersionUID as well? Or do they simply "inherit" the outer class'
version id?

Thanks,

Murray
 
M

Mark Thornton

Murray said:
I know that if you're using Serialization, it's best to specify a
serialVersionUID in your class to aid version tracking/maintenance. If your
class has several inner classes, do each of these also need their own
serialVersionUID as well? Or do they simply "inherit" the outer class'
version id?

Thanks,

Murray

If those inner classes are also serialised, then yes. This is the main
reason why inner classes can now have final static members.

Mark Thornton
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,780
Messages
2,569,611
Members
45,276
Latest member
Sawatmakal

Latest Threads

Top