Author Archives: KK JavaTutorials

Spring Boot Actuator

In this post, We will talk and learn about Spring Boot Actuator Spring Boot provides various features to monitor and manage our application when the project is pushed into production. We can opt to manage and monitor our application by using HTTP endpoints. Auditing, health check, and metrics gathering can also be checked using Actuator… Read More »

What is Spring boot ?

In this post, We will talk about What is Spring boot? Spring Boot is built on top of the traditional spring framework and it provides an easier way to use all the features of the spring framework. Spring Boot provides autoconfigure feature for all Spring beans. We just need to use proper configuration properties files to… Read More »

Spring vs Spring boot

In this post, We will talk about the differences between the standard Spring frameworks and Spring Boot. What is Spring? Spring is an open-source(free) very lightweight java framework that allows us to build simple/complex, reliable, and scalable enterprise-level applications. This framework mainly helps us to manage our business objects in a loosely coupled manner using dependency… Read More »

How to Configure Multiple Data Sources in a Spring Boot?

In this post, We will learn How to Configure Multiple Data Sources in a Spring Boot using a demo project? There are many situations where we need to read/write data from multiple databases and while using Spring data JPA sometimes it becomes challenging to configure to get connections with multiple databases in a single application. Hence,… Read More »

Private Methods in Java 9 Interfaces

Java 9 Private Interface Methods: From Java 9 onwards, we can create private non-static/static methods inside an interface. The interface allows us to define private methods that help to share common code between non-abstract/default methods. Prior to Java 9, When you create private methods inside an interface then you will get a compile-time error. Private methods in interfaces have… Read More »

Java 9 SafeVarargs Annotation

@SafeVarargs annotation was introduced in Java7 and can only be applied on: Final methods Static methods Constructors This annotation is used to ensure that the method/Constructors does not perform unsafe operations on its varargs parameters. From Java 9 onwards, it can also be used with private instance methods. SafeVarargsTest.java

If you run SafeVarargsTest.java as Java Application… Read More »

Java 9 Try with Resource Enhancement

Java introduced try-with-resources feature in Java 7 that helps to close resources automatically after being used. In other words, we can say that we don’t need to close resources (file, connection etc) explicitly, try-with-resource close that automatically by using the AutoClosable interface. If you look in Java 7 then you will find that try-with-resources has a limitation… Read More »

Java 9 Collection Factory Methods Example

In this post, We will talk and learn about Java 9 Collection Factory Methods Example with a demo project Java 9 has added simple ways to create immutable Collections without null values by providing a set of <Collection>.of methods. The created collection should not have null values and should not be modified later else it… Read More »

Java 9 Stream API improvements

In this post, We will talk and learn about Java 9 Stream API improvements using an example Java 9 added the new APIs for Stream. Java Stream Iterate Method A new overloaded iterate method is added in Java 9 stream interface. This function usually help us to iterate stream elements till the specified condition is true.… Read More »

Java 9 Jshell Tutorial

In this post of Java 9 Jshell Tutorial, we will talk and learn all the concepts related to JSHELL using various examples. What is JShell in Java 9? It is an interactive Java Shell tool that allows us to execute Java code from the shell and shows output immediately.JShell is a REPL (Read Evaluate Print Loop)… Read More »