DEV Community

Discussion on: Is there vararg-like generics in Java?

 
alainvanhout profile image
Alain Van Hout

String.class is a object representing the String type. But that's not what is needed here.

Think of it like this: if you have a generic box, a banana box and an apple box, then you can't transform a generic box into a banana box by throwing a banana at it. The banana needs to conceptually be in the picture when the box its design is created.

Thread Thread
 
baenencalin profile image
Calin Baenen • Edited

Okay.

Thanks.
Cheers.