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