Is there a way to ensure an Integer
variable not to be null
?
I need to create a list of integer values, so I cannot use int
type. I need to work with a List<Integer>
but this will allow null
values for elements...
Do I need to use some particular implementation of List
or is there some way to set Integer
not nullable?
Note I need a List
, not a Set
.