Collection<?> c = new ArrayList<String>();
// compile time error, add Object to collection of unknown
Originally posted by rathi ji:
we are using Collection<?> it means it can take any object
Originally posted by Lasse Reichstein Nielsen:
...you can't create an object with runtime type Collection<?>...
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koophttps://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton