Video: Java Puzzlers - Joshua Bloch, Neal Gafter

December 9th, 2014

( )


Book: Java puzzlers - Joshua Bloch, Neal Gafter



  1. Use new BigDecimal(String), not new BigDecimal(double)

  2. Don't assume that map.Entry objects in entrySet iteration are stable

  3. Beware of catastrophic backtracking when writing regex

  4. Generics > arrays, don't ignore compiler warnings!

  5. Never use raw types in new code - they lose all generic type info

  6. Use L for long (not l), never start an int with 0 (makes it octal)

2: new HashSet<EntryType>(map.entrySet()) idiom fails for EnumMap, IdentityHashMap