Hi, I am learning Java, and I just got confused about the question that continues to appear on my exams.
We are told to use the class for our collections.
Usually in my main class I just create an arraylist of the type that I need, like bank accounts or something else. But I think we should make a class for all our data. I tried this and made them static and had an abstract class, because I do not need to make copies of the class itself.
What I want to know is why people just donβt make a type of list that can do everything the arrailist and list can do in one, why are there different types? What are the different types of benefits? Ps makes a collection just mean a class for all your data?
java
Sam
source share