Answer the question
In order to leave comments, you need to log in
How can I add additional information in ArrayList?
Hello!
In an ArrayList I store a pojo Website containing 4 rows.
In the first method in List ArrayList<> I add the first 3 lines (accordingly, the first constructor contains 3 lines). In the second method, I add the last line to the ArrayList<> (+1 extra constructor with the last line). And it turns out that the 4th line is not added to the 3rd previous ones, but additional ones are created. objects null null null line 4. How can you add objects to an ArrayList and still make them look like line 1, line 2, line 3, line 4 (taking into account that they are obtained and added in different methods)? I hope I was able to explain... If necessary, I will provide the source code...
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question