You are viewing a single comment's thread. Return to all comments →
public class Solution {
public static void main(String[] args) { Integer[] intArray = { 1, 2, 3 }; String[] stringArray = { "Hello", "World" }; printArray(intArray); printArray(stringArray); } private static <T> void printArray(T[] array){ for(T element : array){ System.out.println(element); } }
}
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 →
public class Solution {
}