Record class in Java

In Java, the concept of immutable refers to classes whose objects do not change information after they are instantiated. Normally, to declare an immutable class, we would: Declare this class as final so that no class can extend from it. Declare the fields of that… Read More

Using Thymeleaf in Jakarta EE Servlet

In this tutorial, I show you how to integrate Thymeleaf with Jakarta EE Servlet to replace using JSP in Jakarta EE Servlet applications. First, I will create a new Jakarta EE Servlet Maven project as an example: Thymeleaf dependency is as follows:

I will… Read More

Websocket with Socket.IO Java

Socket.IO has 2 main Java implementations Socket.IO Java and Netty-socketio. Netty-socketio only implements Socket.IO 2.x and Socket.IO Java implements the latest version of Socket.IO. Therefore, if you want to implement a Websocket server with Socket.IO using Java, please use the version of Socket.IO Java! In… Read More

Sealed class in Java

In Java, to prevent the inheritance of a certain class, we will use the final keyword to declare that class. Examples are as follows:

Class Test will not be able to inherit JavaExample class because this JavaExample class is declared with final: A need… Read More

Introduction to Socket.IO

Socket.IO is a library that makes us possible to implement a 2-way communication channel between client and server with low latency based on events. We can use Socket.IO to implement a WebSocket server. Originally Socket.IO was written in JavaScript but some other languages are also… Read More