- Optional
1. The Billion Dollar Mistake In 2009, Sir Tony Hoare — the computer scientist who invented the null reference in 1965 for the ALGOL W language — delivered a now-famous keynote titled “Null References: The Billion Dollar Mistake.” He said: “I call it my billion-dollar mistake. It was the invention…
- StringJoiner
1. What is StringJoiner? StringJoiner is a utility class introduced in Java 8 that builds a sequence of characters separated by a delimiter, with optional prefix and suffix. It lives in java.util and solves a problem every Java developer has faced: how do you join a list of strings with commas (or…
- Collectors class
1. What is the Collectors Class? When you use the Stream API, the collect() terminal operation is how you transform a stream back into a concrete data structure — a List, a Set, a Map, a String, or even a custom container. But collect() does not know how to build these structures on its own. […]
- Foreach
1. What is forEach? Imagine you are a teacher handing back graded papers. You pick up each paper from the stack, call the student’s name, and hand it over. You do not care about the paper’s position in the stack — you just process each one in order until the stack is empty. That is […]
- Streams
1. What is the Stream API? Think of a conveyor belt in a sushi restaurant. Plates of sushi travel along the belt, and you — the customer — pick only the ones you want, maybe add some soy sauce, and eat them. You never rearrange the kitchen. You never touch the plates you skip. You […]