# | Line 64 | Line 64 | public class CollectionWordLoops { | |
---|---|---|
64 | ||
65 | static Collection<String> newCollection(Class<?> cl) { | |
66 | try { | |
67 | < | Collection m = (Collection<String>) cl.newInstance(); |
68 | < | return m; |
67 | > | return (Collection<String>) cl.getConstructor().newInstance(); |
68 | } catch (Exception e) { | |
69 | throw new RuntimeException("Can't instantiate " + cl + ": " + e); | |
70 | } |
– | Removed lines |
+ | Added lines |
< | Changed lines |
> | Changed lines |