Answer the question
In order to leave comments, you need to log in
What is the correct way to create an ArrayList array?
Hello, in the program I use an array of object sheets. But when I try to interact with ArrayLists, I get a NullPointerException error. Could someone suggest how to solve this problem?
Answer the question
In order to leave comments, you need to log in
You create an array of lists of size colors. The array is initially filled with nulls. Therefore, when you take a certain element of this array, and call a method on it, an NPE occurs.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question