We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
publicstaticvoidmain(String[]args){/* Enter your code here. Read input from STDIN. Print output to STDOUT. Your class should be named Solution. */List<Integer>arInt=newArrayList<>();arInt.add(1);arInt.add(2);arInt.add(3);List<String>arStr=newArrayList<>();arStr.add("Hello");arStr.add("World");printArray(arInt);printArray(arStr);}publicstatic<T>voidprintArray(List<T>o){o.forEach(a->System.out.println(a.toString()));}
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Java Generics
You are viewing a single comment's thread. Return to all comments →
Giving 0 star to this qus.