Core java
- 05 September
Java 8 functional interface example
In this post , we are going to see about functional interface in java. It is closely related to java lambda expressions. Functional interfaces are those interfaces which have only one abstract method, it can have default methods, static methods and it can also override java.lang.Object class method. There are many functional interfaces already present. […]
- 03 September
Java 8 Predicate Example
1. Introduction Java 8 predicate is functional interface introduced in java 8. This feature is a part of the java.util.function package, which is dedicated to functional interfaces. The primary goal of using predicates is to filter or match objects based on specific criteria. For example, if we have a box of apples and we want […]
- 01 September
Collectors.groupby example : How to do group by in java
We have already seen some examples on Collectors in previous post. Â In this post, we are going to see Java 8 Collectors groupby example. Groupby is another feature added in java 8 and it is very much similar to SQL/Oracle. Lets understand more with the help of example: Lets create our model class country as […]
- 31 August
Java 8 Collectors examples
In this post, Â we are going to see java 8 Collectors examples. You can do various operations such as average, count, groupby, sort the list with the help of Collectors. I am not providing theory here, I think you will learn better with the help of examples. Examples: Counting: Counting is used to count number […]
- 30 August
Java 8 Lambda Expression examples using Comparator
Java 8 has made comparator more powerful using Lambda Expression. It has introduced many new APIs for Comparator. Let’s go through some new features of the Comparator using Lambda expression.Let’s create a very simple class called Employee: [crayon-6743b3a1e1272661228361/] Sort Employee list by name in classic way: We will sort employee list in classic way [crayon-6743b3a1e1277163140167/] […]
- 17 July
How to create custom exception in java
In this post, we will see how to create custom exception in java. It is very simple to create custom exception in java. You just need to extends Exception class to create custom exception. Lets understand this with example. You have list of counties and if You have “USA” in list of country, then you […]
- 15 July
Java String Interview questions and answers
In this post, we will see interview questions on java String. String is most important data type which we use in our programs very often. 1. Why String is declared final or immutable in java? There are various reasons to make String immutable. String pool Thread Safe Security Class Loading Cache hash value You can […]
- 15 July
Find all Permutations of a String in java
In this post, we will see how to find all permutations of String in java. We will use a very simple approach to do it. Take out first character of String and insert into different places of permutations of remaining String recursively. Lets say you have String as ABC. So we take out A from […]
- 14 July
How to use connection pool using service locator design Pattern in java
In this post, you will learn about the Connection Pool. This post is intended by java application development experts for entire development community to let people learn and acknowledge about Connection Pool and how to use its object using Service Locator design pattern. Introduction Connection pool is a mechanism which applicable for all technologies in […]