[Solved] Why am i NOT getting null pointer exception in this case while adding null to a list and sorting it


That loop only goes to 4 for i, so you don’t end up inserting anything when you change the conditon to i == 5.

1

solved Why am i NOT getting null pointer exception in this case while adding null to a list and sorting it