About Question enthuware.ocpjp.v8.2.1270: probably a typo
Posted: Mon Feb 05, 2018 12:46 pm
Hi, probably there is a typo in the explanation related to the last checkbox option:
because there is size() method in List, not getSize():
Code: Select all
List<String> list = new ArrayList<>(10);
Additionally: there are some new line chars missing in the main explanation, so sample code lines look like they have invalid comments, for example:[...] So list.getSize() would still return 0.
Map<String, List<String>> myMap = new HashMap<String, List<String>>();In Java SE 7, you can substitute the parameterized type of the constructor with an empty set of type parameters (<>):