What is point of constraint validation @Null?
问题 I was checking list of available constraints in javax.validation package and I noticed that there is an annotation @Null which force the field to be null. I do not understand what is point of adding it to my field if I already know it should be null. For example look at this class: public class MyClass{ @NotNull private String myString1; @Null private String myString2; // getter setters... } @NotNull completely makes sense. I do not expect myString1 to be null. but @Null makes myString2