The syntax of generic classes and methods was not added until version
The syntax of generic classes and methods was not added until version
5.0 of Java. Nonetheless, early versions of the language had collections classes such as an array list, or a linked list which were able to store objects, instances of different classes.
a. How were those classes implemented without the generic syntax?
b. Give an example of a program that uses the non-generic version of a class and the equivalent program that uses the generic version. How do the two implementations differ?
c. Why is having the syntax of generics better? Explain and illustrate with a method of the example class.