Should serialVersionUID be unique for different classes?
serialVersionUID
is needed to remember versions of the class. It should be same while serializing and deserializing. It is a good programming practice to provide this value rather than JVM assigning one(generally it is hash). It is not necessary for two classes to have unique values.
Yes, you can. Serial versions of different classes are independent and do not interfere each other.
PS
Eclipse even proposes you to set serialVersionID
by default value that is 1L
.