Hi guys, I would like to ask you that how could we...
# announcements
n
Hi guys, I would like to ask you that how could we check if the list is null only, the list could be empty that's fine but shouldn't be null, could someone help me?
z
list.any { it == null }
n
if we use
list.equals(null)
is this the same comparison ? no?
n
No
Are you wanting to check if the list itself is null or has null elements
n
just to check if the list is null
n
Then list == null
But usually that should be impossible
What's the type of list
n
it's custom class
d
Then
list == null
assuming that
list
is of type
List<MyCustomClass>?