When you declare your class as rentalGeneric<Integer>, this doesn't mean that your class rentalGeneric has type java.lang.Integer. Try this
Basically you are just using Integer instead of T but that doesn't make your Integer the java.lang.Integer class. So don't use anything like Integer or
String with your class declaration as it doesn't mean what you think it means.
As far as methods go, your code doesn't use generic methods very well. You've shown list.add as a statement in your method but where is this list declared. If a generic method is used in conjunction with generic class, then it works like this
Now if you want to use this class, then here's how you can use it
So here you declare your class to have Integer as the type of T, so you pass the display method a List of Integers. If you want to use a generic method which declares its own type, then here's how you can do it.
This method will accept an array list of a specific type and return a LinkedList of the same type. This is how you can call it