📝 Research :https://ojitha.blogspot.com.au for my lengthy articles.

Java Annotations

April 1, 2021

Annotations are metadata that provide information at the retention level of Java source, class or runtime.

More…

Understand JPMS

March 27, 2021

Java Platform Module System (JPMS) has been introduced since Java 9. With Java 9, JDK has been divided into 90 modules. This is a simple example created using IntelliJ IDEA.

module-info

As shown in the above diagram, there are three modules, Application, Service and Provider.

download soruce

More…

Java Thread interrupt

March 23, 2021

It is important to understand how the Java thread interrupt work.

image-20210326104946921

Source Target Action
New Runnable thread start().
Runnable Blocked synchronized lock on.
Runnable waiting when object call Object.wait().
Runnable timed-waiting when Thread.sleep(...).
Runnable Terminated When thread finished.
More…

Use of default and static methods

March 16, 2021

A default method added to maintain the backward compatibility which allows older classes (without modifications) to access new version of an interface.

Java 9 interfaces can have private methods and private staic methods. These methods support code reusabilit in the interface level.

More…

Java Nested Classes

March 15, 2021

Classes can be defined inside other classes to encapsulate logic and constrain the context of use. For example:

TestOrder

More…