Say we have an array, and we have an if sentence that check if the content of the array[i] is the same. For example we have an Person[] array = new Person[10]; And we are gonna return the Person in the array that has the name "Tom".
Then we would make a for-loop and check every element or slot in the array.
if(Person[i].getName().equals("Tom"))
or == "Tom" . Do we need an if-sentence that check if the Person[i] != null? Is there ny point, will it limit the amount of null pointer exceptions?