Saturday, 17 August 2013

Different types of lists

Different types of lists

Hello I am studying Java and I am just confused about a question that
keeps coming up in my exams.
We are told to use a class for our collections.
Usually in my main class I just make an arraylist of the type I need like
bank accounts or whatever. But I think we are supposed to make a class for
all our data. I tried this and made them static and have the class
abstract because I don't need to make copies of the class itself.
What I want to know is why don't people just make a list type that can do
everything an arraylist and list can do in one, why is there different
types? What are the benifits of having different types? Ps does a
collection just mean a class for all your data?

No comments:

Post a Comment