For example, there is a class that implements the Java.io.Serialize interface:
Package com.on.test;
public class Testserial implements Java.io.Serializable {
}
If the code is written just like this, it will give you a yellow warning in eclipse, why, because you implemented the serializable interface, but did not give
Private static final long serialversionuid = 5952689219411916553L;
A private field like this (this field is required to implement the serializable interface, but does not have to)
As long as you add a field like this, the yellow warning disappears, but if you don't want to add the field and don't want to see the yellow warning, it's OK to add a note to the Class (@SuppressWarnings ("Serial").
Package com.on.test;
@SuppressWarnings ("Serial")
public class Testserial implements Java.io.Serializable {
}
So eclipse won't have that yellow warning.
However, we recommend that you give the private static final long serialversionuid = 5952689219411916553L;
When your class is serialized and deserialized, if you do not have this field can be problematic, so try to add this field, do not use @suppresswarnings ("serial") annotation