• + 0 comments

    Giving 0 star to this qus.

    public static void main(String[] args) {
            /* Enter your code here. Read input from STDIN. Print output to STDOUT. Your class should be named Solution. */
            List<Integer> arInt = new ArrayList<>();
            arInt.add(1);
            arInt.add(2);
            arInt.add(3);
            
            List<String> arStr = new ArrayList<>();
            arStr.add("Hello");
            arStr.add("World");
            printArray(arInt);
            printArray(arStr);
        }
        
        public static<T> void printArray(List<T> o){
            o.forEach(a -> System.out.println(a.toString()));
        }