Sometimes when writing Java in Eclipse, I write code that generates warnings. Common is this that I get when extending a class Exception:
public class NumberDivideException extends Exception {
public NumberDivideException() {
super("Illegal complex number operation!");
}
public NumberDivideException(String s) {
super(s);
}
}
Warning:
The serializable NumberDivideException class does not declare a static final field serialVersionUID of type long.
I know that this warning is caused by my failure ... well, it says right above. I could solve this by including serialVersionUID, but this is a one-hour assignment for the school; I do not plan to serialize it anytime soon ...
Another option, of course, is the ability to add Eclipse @SuppressWarnings("serial").
But every time my mouse hangs over an option Suppress, I feel a little guilty.
, ?
( , "" serialVersionUID serialVersionUID = -1049317663306637382L; serialVersionUID - ?)
EDIT: , , ... !
, ...