I was researching ways to deal with NullPointerExceptions and three things that I found to be most useful:
- Request statement
- Comments (@Noall, @Null Worthy)
-
"?." Using the example as a tap check example: If (MyRef! = Null) {MyRef.doSomething (); }
The above code can be changed in: MyRef? .doSomething ();
>
No comments:
Post a Comment