You are viewing a single comment's thread. Return to all comments →
import java.io.; import java.util.;
public class Solution {
public static void main(String[] args) { ArrayList<String> strings = new ArrayList<>(); strings.add("Hello"); strings.add("World"); ArrayList<Integer> integers = new ArrayList<>(); integers.add(1); integers.add(2); integers.add(3); show(integers); show(strings); } public static void show(List<?> list) { for(int i = 0;i < list.size();i++) { System.out.println(list.get(i) + ""); } }
}
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 →
import java.io.; import java.util.;
public class Solution {
}