My writing.

Java internals, framework quirks, and the occasional Linux command. Explanations and examples for the next time you’re figuring something out.

Articles.

49–54 of 148 articles
java

Why one should prefer class hierarchies over tagged classes in Java?

How class hierarchies can replace tag fields and scattered conditional logic with polymorphism.

9 views 2 likes 0 shares
java

Why one should use Varargs judiciously in Java?

Balance the convenience of varargs with array allocation costs and generic type-safety concerns.

3 views 1 like 0 shares
java

Why one should prefer Collections over Stream as a return type?

Why collections can provide a more flexible return type than single-use streams.

4 views 1 like 0 shares
java

Why one should override Object.clone() judiciously?

The pitfalls of Cloneable, shallow copies, mutable state, and inheritance in Java object copying.

3 views 1 like 0 shares
java

Why obsolete references should be eliminated in Java?

Why unused object references can cause memory leaks, and where to clear them.

4 views 0 likes 0 shares
java

Why one should prefer try-with-resources over try-finally in Java?

Simplify resource cleanup and exception handling with Java's try-with-resources statement.

2 views 1 like 0 shares