One case where it is needed (often with unsafe casts mixed in) is when writing generic containers of non-null elements (backed by a nullable array)
Related topics
Topic | Replies | Views | Activity | |
---|---|---|---|---|
requireNotNull or "!!"? | 1 | 3079 | March 28, 2016 | |
Purpose of double exclamation operator (null check) | 4 | 17164 | July 30, 2018 | |
Not-Null Assertion Is Pointless
|
6 | 275 | April 16, 2025 | |
The need for ! operator seems verbose
|
2 | 964 | November 29, 2012 | |
Operator!
|
2 | 897 | March 2, 2014 |