Example
why is List added before <Student> since ArrayList already implements the List interface by default. Just seems redundant. Why not make it like this:
I understand you may want to make a variable of an interface type but I don't understand why classes that already implement an interface in the
Java API do this. Maybe I'm thinking of this the wrong way. Any clarification of this would be appreciated. Thank you coderanch.
edit: Is it because if I decide later I want to change value of the variable( to linkedlist or vector) I wouldn't be able since it was declared it of type ArrayList<> instead of List<> ?