Last active
December 7, 2016 15:45
-
-
Save gaplo917/d302fd3e64082560e92af5d58dd246b7 to your computer and use it in GitHub Desktop.
Java has no Type Inference that makes code become verbose
This file contains 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
// Java 9 | |
final Map<String,Integer> abc = Map.of("a",1, "b", 2, "c", 3); | |
// Java >= 5 | |
final Map<String,Integer> abc = new HashMap<String, Integer>() {{ | |
put("a",1); | |
put("b",2); | |
put("c",3); | |
}}; | |
final Integer c = abc.get("c"); | |
// Question: | |
// If you are asked to refactor from Map<String,Integer> to Map<String,String>, | |
// try to estimate the efforts! | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment