Skip to content

Instantly share code, notes, and snippets.

Created July 12, 2017 17:41
What would you like to do?
Java Variance Test
import java.util.ArrayList;
import java.util.List;
public class Variance {
public static void main(String[] args) {
String str = "";
Object obj = str;
List<String> listStr = new ArrayList<>();
// List<Object> objects = listStr; // compile error
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment