What is Epoch time and how do you get it in Java?

Epoch time, also known as Unix time or POSIX time, is a system for representing timestamps as the number of seconds that have elapsed since a specific reference point called the "epoch." The epoch is a fixed point in time from which all other timestamps are measured. In the context of Unix-based operating systems and … Continue reading What is Epoch time and how do you get it in Java?

What is a spring bean and is it different from Java class?

Spring beans and Java classes are both objects in Java, but they have different characteristics and are used for different purposes. A Spring bean is an object that is managed by the Spring Framework. This means that the Spring Framework is responsible for creating, configuring, and destroying the bean. Spring beans are typically used to … Continue reading What is a spring bean and is it different from Java class?

Inheritance & Java Sealed Classes

In Java, inheritance allows you to inherit the fields, methods, and nested classes of the parent class, and also add new features through polymorphism and method overriding. Declaring a class as final , prevents the class from getting inherited or extended. So at one end of the spectrum we have inheritance, which allows any subclass … Continue reading Inheritance & Java Sealed Classes

How do you add custom response headers in a Spring Boot application?

To add custom response headers in a Spring boot application use ResponeEntity class. Set the values using HttpHeader object. Set the header object in response entity To set a response header for all the response , implement a Filter class and set the header in the ServletResponse class Code Snippet @Component public class ResFilter implements … Continue reading How do you add custom response headers in a Spring Boot application?

Java microservices with GraalVM

Microservice is a trending and popular architecture to build applications as it allows organizations to be agile and adopt DevOps and continuous testing practices.Spring Boot is a very popular technology choice to build java based microservices, but it consumes a good amount of memory and spring's runtime reflection approach leads to longer startup times as … Continue reading Java microservices with GraalVM

GraalVM : A JVM written in Java for high performant applications !!

The HotSpot JVM which i shared in the previous blog is suited and optimized for traditional on-premise based applications to provide high throughput and stability.New modern applications are being built for cloud as distributed systems developed using microservices, event driven, asynchronous and reactive design which should scale quickly and efficientlyHotSpot JVM and JIT compiler is … Continue reading GraalVM : A JVM written in Java for high performant applications !!

Execution of a Java Program & Role of Just In Time (JIT) Complier

When we write a Java program and issue a javac command , the program is compiled to bytecode.To execute this program, we issue a java command and when we do so, the bytecode generated by javac is interpreted by the Java Virtual Machine (JVM) to produce machine code which is ultimately fed to CPU to … Continue reading Execution of a Java Program & Role of Just In Time (JIT) Complier

Concurrency & Parallelism in Java

Concurrency and Parallelism are often used with respect to multithreaded programs and both have different meanings in this context. Concurrency is about processing more than one task at same time but not necessarily simultaneously, It is applied to reduce the response time of the system by using the single processing unit. In a concurrent application, … Continue reading Concurrency & Parallelism in Java