NullPointerException when Creating an Array of objects [duplicate]

You created the array but didn’t put anything in it, so you have an array that contains 5 elements, all of which are null. You could add

boll[0] = new ResultList();

before the line where you set boll[0].name.

Leave a Comment