null - Make non-nullable type in Java -


Is it possible to create non-null type in Java? Such items should not be blank. how?

This is a common practice common to use a @note annotation, which by some IDE Supported and in Maven Plugin Java 8 you can write

  @NotNull string text; @No List & lt; @NotNull string & gt; Wire = ...;   

This is not a language feature, but if you need it, then it is available.

Note: There is no standard @ note annotation :( Tools that support you, it allows you to configure what you want. I use one that comes with Intelia It gives you warnings in the editor with automatic corrections and adds runtime checks for null arguments, back value and variables.

Note: In IntelliJ work If any area is not eligible for use.

Comments

Popular posts from this blog

Java - Error: no suitable method found for add(int, java.lang.String) -

java - JPA TypedQuery: Parameter value element did not match expected type -

c++ - static template member variable has internal linkage but is not defined -