Skip to content

Instantly share code, notes, and snippets.

@jbranchaud
Last active December 17, 2015 08:19
Show Gist options
  • Save jbranchaud/5579140 to your computer and use it in GitHub Desktop.
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.
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