Java annotations feel like sticky notes you can attach to code without changing what the method or class does. What are Java annotations They are metadata baked right into the source. Think of @Override, @Deprecated, or the JUnit 4 @Test you have likely seen this week. The compiler and tools…
Tag: coding-practices
Enhanced for loop in Java 5
I keep running into moments where the enhanced for loop in Java 5 turns a messy block into something I can read in one sip of coffee. J2SE 5.0 brought shiny stuff like generics and annotations, yet the quiet hero for day to day code is the foreach style loop….
New in Java 5: Generics
Generics just landed in Java 5 and they already changed the way my code reads in the editor. Before this release we lived with raw types. Collections gave back Object, so every read needed a cast and every cast was a tiny gamble. The code worked until it did not…