In addition to catching code errors and going through debugging hell, I also obsess over whether writing in an active voice is truly better than doing it in passive.
Java 8 Streams - Guide to findFirst() and findAny()
The findFirst() and findAny() methods are terminal operations (terminate and return results) of the Stream API. Yet, there is something special about them - they not only terminate a stream, but also short circuit it: List<String> people = List.of("John", "Janette", "Maria&...
Java 8 Streams: Guide to the filter() Method
The Java Streams API simplifies working with a collection of elements. Because streams turn these elements into a pipeline, you could test them using a set of conditions (known as predicates), before finally acting on those that meet your criteria. The filter() method is one such operation that tests the...
Java 8 Streams: Convert a Stream to List
Streams don't hold any data by themselves - they just stream it from a source. Yet, common code routines expect some sort of a structure to hold results after processing data. That is why, after (optional) intermediate operations, the Stream API provides for ways to convert the elements that it...
Method Overriding in Java
Object-Oriented Programming (OOP) encourages us to model real-world objects in code. And the thing with objects is that some share outward appearances. Also, a group of them may display similar behavior. Java is an excellent language to cater to OOP. It allows objects to inherit the common characteristics of a...
Guide to Overloading Methods in Java
Java defines a method as a unit of the tasks that a class can perform. And proper programming practice encourages us to ensure a method does one thing and one thing only. It is also normal to have one method call another method when conducting a routine. Still, you expect...
Working with PostgreSQL in Java
PostgreSQL (which goes by the moniker Postgres) is famous for its object-relational nature. In contrast, other database systems are usually relational. Due to its nature, it's a great pairing with Java, which is heavily object-oriented. Accessing a Postgres database using Java requires you to rely on the JDBC API, as...