> This means that if text2 is null, the replace() method call is ignored and no NullPointerException is thrown.
I don't understand why this is preferable.
I don't understand why this is preferable.
if (text2 != null) {
text2.replace()
}
Essentially they're moving support for @Nullable and @NotNull into the language and compiler.