So in another code, I can initiate "test" instances by either passing two arguments (each is of type List<Integer> , or passing two arguments (each is of type List<String> .
but I still feel this is bit like too much "hardcoded". Is there any way to improve this to make it more elegant by taking advantage of jdk generic features ? Since I am new to generic it will be very helpful if you ive few code snippet so I know what you are talking about.
posted 8 years ago
How about this?
If you need to have two types, change the class definition to