About Question enthuware.ocpjp.v7.2.1380 :
Posted: Fri Jun 26, 2015 12:54 pm
Why the first option incorrect? Please try the following:
The output is:
You see, this is considered even a special case and properly handled in AbstractMap.toString().
Code: Select all
Map<Map<?, ?>, String> m = new HashMap<Map<?, ?>, String>();
m.put(m, "value");
System.out.println(m);
Code: Select all
{(this Map)=value}