WILLIAM
Tuesday, 6 August 2013
how to properly cast nested generic types in java
how to properly cast nested generic types in java
In Java I can cast:
List<?> j = null;
List<Integer> j2 = (List<Integer>)j;
so why does the following fail?
List<List<?>> i = null;
List<List<Integer>> i2 = (List<List<Integer>>)i;
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment