Created
November 27, 2013 19:43
-
-
Save kmb385/7681956 to your computer and use it in GitHub Desktop.
Array with component type that is a parameterized type
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class ArrayStoreCheck { | |
/** | |
* @param args | |
*/ | |
public static void main(String[] args) { | |
LinkedList integers = new LinkedList<Integer>(); | |
integers.add(1); | |
LinkedList<String> strings = new LinkedList<String>(); | |
LinkedList<String>[] lists = new LinkedList[20]; | |
lists[0] = strings; | |
lists[1] = integers; | |
strings.add("Hello"); | |
System.out.println(lists[0].get(0)); | |
System.out.println(lists[1].get(0)); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment