We have something like
List lst = new LinkedList();
which shows that List is some sort of Class. So, why call it an Interface? We can simply call it an Abstract class which implements Collection.
Interfaces and Abstract classes are used for different purposes. See this question.
A List defines a set of behaviour we want list-type objects to have, not the basis for a hierarchy of data structures. It doesn't need to specify any shared behaviour or anything like that. It just has the simple job of saying "everything that wants to call itself a List should be able to do these things"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With