Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save jasonqu/11244174 to your computer and use it in GitHub Desktop.
Save jasonqu/11244174 to your computer and use it in GitHub Desktop.
// in scala, map type error could be check in compile time
val map = Map(1 -> "a")
map.get("a")
// in java, it cannot
Map<Integer, String> map = new HashMap<>();
map.put(1, "a");
map.get("a");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment