Posts with #JavaTraps

#JavaTraps

Public posts on X that use #JavaTraps.

Related hashtags

  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
    Download
    016451
  2. 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
    Download
    004173
  3. 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
    Download
    003164
  4. Show more posts