Last active
December 17, 2015 08:19
-
-
Save jbranchaud/5579140 to your computer and use it in GitHub Desktop.
An example of Java code that won't compile because of generics erasure.
This file contains hidden or 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
import java.util.List; | |
public class GenericsErasure { | |
public static void main(String[] args) { | |
//... | |
} | |
public static void printList(List list) { | |
//... | |
} | |
public static void printList(List<Integer> list) { | |
//... | |
} | |
public static void printList(List<String> list) { | |
// ... | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment