JPMS: An Overview

Initially, JCP (Java Community Process) started developing JPMS(Java Platform Module System) in 2006 as JSR 277, and it was scheduled to be released in Java 7. But for some reason, it wasn’t. In 2008, this JSR was dropped and replaced by JSR 376 under the umbrella of project Jigsaw. Eventually, it was released in Java […]

Core Java: Date and Time

Since Java 8, Oracle completely rebuilt its Date/Time API. The new API is supposed to replace the old one. The new API which is located in the java.time package is thread-safe because most of the new classes are immutable, meaning that, after the object is constructed, it cannot be modified. This is especially useful when […]

Java Generics: Type Erasure & Wildcards

Specifying the generic type allows Java to perform type checking at compile-time. But when using generics in your code, due to “Type Erasure” that occurs at compile-time, generic type parameters are converted to the Object type. This makes generic type parameters unable to call other methods except for the Object ones. What if we want […]

Concurrency: Thread Safety In Java

What is Thread safety? To save you the time from looking up to Wikipedia here is the definition: Thread safety is a computer programming concept applicable to multi-threaded code. Thread-safe code only manipulates shared data structures in a manner that ensures that all threads behave properly and fulfill their design specifications without unintended interaction. What […]

Core Java: Comparator vs. Comparable

When working with custom objects, we often want to compare them based on some pre-defined criteria. That’s why we use the Comparable interface to implement a natural ordering for our custom objects. Also, we often need to specify a total ordering if there is no natural ordering implemented by our custom object or override the […]