My writing.

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

Articles.

31–36 of 128 articles
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.

2 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.

1 view 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.

2 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.

1 view 1 like 0 shares
Java

Why one should prefer static factory methods over constructors in Java?

How named factory methods offer flexible object creation, caching, and clearer Java APIs.

1 view 1 like 0 shares
Java

Why one should always override hashCode() & equals() together?

How the equals and hashCode contract affects object equality and hash-based collections.

1 view 1 like 0 shares