For example, there is a class that implements the Java.io.Serialize interface:
Package com.onede4.test;
public class Testserial implements Java.io.Serializable {
}
If the code just writes this, putting it in eclipse will give you a yellow warning, 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 not required)
Just add a field like this and the yellow warning disappears, but if you don't want to add this field and don't want to see that yellow warning, no problem, add an annotation to the class (@SuppressWarnings ("Serial"))
Package com.onede4.test;
@SuppressWarnings ("Serial")
public class Testserial implements Java.io.Serializable {
}
So eclipse won't have that yellow warning.
However, we recommend the private static final long serialversionuid = 5952689219411916553L;
When your class is serialized and deserialized, if there is a problem with this field, try adding this field instead of @suppresswarnings ("serial") annotations
What do you mean by adding @suppresswarnings ("serial") to the
Java program?