Skip to content
Advertisement

Tag: null

How to set arrayList size as null?

Why the size of the arrayList choice is 5 when all the elements have been set to null Answer Because the ArrayList still contains 5 Objects. They are null, but they are objects, thus present in the list! You can empty the ArrayList, by calling choice.clear();

Advertisement