I am attempting to add validation
for my ArrayList
if it is null
, below is my current implementation:
List<Person> personList = new ArrayList<>():
if(personList!=null){
//do something
}
However, this still throws an exception
If the list is deemed to be null, how can I fix this?