Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@jwalgemoed
Last active May 20, 2018 09:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jwalgemoed/7a9798ffcac95875132afbae0830a3ba to your computer and use it in GitHub Desktop.
Save jwalgemoed/7a9798ffcac95875132afbae0830a3ba to your computer and use it in GitHub Desktop.
// We can explicitly work against interfaces
List<String> list = new ArrayList(); // type: List<String>
// Using var, we can't do this without casting
var list = new ArrayList<String>(); // Inferred type ArrayList<String>
var list = (List)new ArrayList<String>(); // Inferred type List<String>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment