Java8

Merge Lists of Map to Map, Java 8 Style!

Reading Time: 3 minutes Today, while doing my work and having fun programming, I came across a problem that looked pretty easy in the beginning, but after starting doing it, had to take help of Google and read from different sites to get to a nice implementation. So, let’s look at the problem and how to solve it. The Problem Well, you guys probably already have guessed what the Continue Reading

Java concurrency: Reentrant Locks

Reading Time: 3 minutes Hello readers! Welcome to another blog in the Java concurrency series. Today, we are going to look at the Reentrant Locks in Java. What it is, how to use it, and mainly, what is the difference between using Reentrant Locks and synchronization. So, let’s dive straight into it. Reentrant Locks Reentrant locks work just like the synchronized locks in java, but have much more facilities Continue Reading

How to deal with Inheritance while using Lombok builder

Reading Time: 2 minutes Today, I came across a problem and found a beautiful solution for it, which is pretty much straight forward, but the problem may occur to anyone while using the Lombok Library for java. So let’s look at the problem. The Problem I have a class Person, which consists of some fields. It is annotated with the @Builder annotation of lombok, so that lombok can generate Continue Reading

StackWalker in Java9

Reading Time: 2 minutes StackWalker was introduced in JDK9 as Stack Walking API or JEP-259.  StackWalker gives the snapshot of the stack trace of the current thread at any given point of time and has methods to walk over it. Now, we can easily filter out the information required, sort them and perform almost all the stream operations provided by Java.

Basics of Functional Interface And Lambda Expression in Java8

Reading Time: 3 minutes Java is based on OOPS concepts and abstraction is one of its feature. So by using interfaces in Java, we achieve abstraction. Like a class, an interface can have methods and variables, but the methods declared in an interface are by default abstract (method signature without body).

Installation and switching between multiple versions of Java

Reading Time: 2 minutes Having trouble in keeping multiple versions of Java in your single system? You have approached at the right place for seeking the solution. In this blog, we will learn how to keep multiple versions of java in your system and how to switch between them as per your convenience. Before moving forward, let’s have a basic understanding of what is SDKMAN?

Functional Interfaces In Java8

Reading Time: 2 minutes Hello readers, as you have visited here, you must be aware of Interfaces in Java. Before Java 8, all methods defined in an interface are public and abstract by default. After Java 8, there were certain enhancements in interfaces. Amongst all the enhancements in Java 8, one of them is “Functional Interface”. What are Functional Interfaces? In Java, the term functional interface refers to those Continue Reading

Future vs CompletableFuture in Java- #2

Reading Time: 3 minutes In our previous blog – Future vs CompletableFuture – #1, we compared Java 5’s Future with Java 8’s CompletableFuture on the basis of two categories i.e. manual completion and attaching a callable method. Now, we will be comparing them on the basis of next 3 categories i.e. Combining 2 CompletableFutures together Combining multiple CompletableFutures together Exception Handling Let’s have a look at each one of Continue Reading

Future vs CompletableFuture in Java – #1

Reading Time: 4 minutes This is Part 1 of Future vs CompletableFuture. In this blog we will be comparing Java 5’s Future with Java 8’s CompletableFuture on the basis of two categories i.e. manual completion and attaching a callable method. What is CompletableFuture? CompletableFuture is used for asynchronous programming in Java. Asynchronous programming is a means of writing non-blocking code by running a task on a separate thread than Continue Reading

Knoldus Pune Careers - Hiring Freshers

Get a head start on your career at Knoldus. Join us!