Harikrishna Gorrepati wrote:
List l2 = new ArrayList<String>(); //What is the use of this ?
Consider you're using an old
Java library which doesn't use Generics.
Consider following class is from that library:
Now, if your new code uses
String as generic parameter like this:
Then, the statement asked in the question is useful.
The variable lst2 is used just for the sake of explanation.
You can also call
new GenDecl().funcName(lst); directly.