Posty z #JavaTraps

#JavaTraps

Publiczne posty w X, które używają #JavaTraps.

Powiązane hashtagi

  1. Nidhi Tiwari@NidhiDevNotes
    Java Traps #15 “Immutable” classes that aren’t actually immutable Your class can be final and still be mutable if it exposes or stores mutable objects incorrectly. final protects references, not data. Defensive copies = real immutability #Java #JavaTraps #SoftwareEngineering #TechTwitter
    Pobierz
    016451
  2. Nidhi Tiwari@NidhiDevNotes
    Java Traps #14 Synchronized on the wrong object synchronized only works if all threads lock the same object. If you lock on new Object(), every thread gets its own lock. So everyone thinks they’re synchronized but no one actually is. #Java #JavaTraps #TechTwitter #SoftwareEngineering
    Pobierz
    004335
  3. Nidhi Tiwari@NidhiDevNotes
    Java Traps #7 Concurrent Modification The for-each loop is secretly using an iterator. When you modify the list directly, the loop and the collection go out of sync. Java fails fast and throws an exception to stop corrupt or unpredictable behaviour early. #Java #JavaTraps #SoftwareEngineering #TechTwitter
    Pobierz
    004173
  4. Nidhi Tiwari@NidhiDevNotes
    Java Traps #6 Floating Point Comparison Java can’t store some decimal numbers exactly, so math with doubles isn’t perfectly accurate. That’s why you compare them using a small tolerance instead of ==. #Java #JavaTraps #SoftwareEngineering
    Pobierz
    003164
  5. Pokaż więcej postów