June 2018
Beginner
722 pages
18h 47m
English
Two methods allow the direct removal of Map elements:
Here is the code that illustrates the described behavior:
Map<Integer, String> map = new HashMap<>();map.put(1, null);map.put(2, "s2");map.put(3, "s3");System.out.println(map.remove(2)); //prints: s2System.out.println(map); //prints: {1=null, 3=s3}System.out.println(map.remove(4)); //prints: nullSystem.out.println(map); ...
Read now
Unlock full access