April 2019
Intermediate to advanced
360 pages
9h 17m
English
Our FailFastImplementation2 class is similar to our FailFastImplementation1 class from the previous section. We start with the import statements, the class definition and, the main() method definition, and then output a blank line to the console. Here is that code:
package CH9FailFast;import java.util.ConcurrentModificationException;import java.util.HashMap;import java.util.Iterator;import java.util.Map;public class FailFastImplementation2 { public static void main(String[] args) throws ConcurrentModificationException { System.out.println(); Map<String, String> firstLast = new HashMap<String, String>(); firstLast.put("Kay", "Brentwood"); firstLast.put("Daisy", "Jinsen"); firstLast.put("Frank", "Corsack"); firstLast.put( ...Read now
Unlock full access