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