Insertion sort in java

This article is about insertion sorting algorithm in java. For example we want to sort below array of integers. int[] input = { 5, 3, 8, 14, 24, 13, 35, 1, 2, 0 }; Insertion sorting start with comparing 2nd integers with first integer like in above array we will compare 3 with 5 here […]

Share
Continue reading →

Constructor reference in java 8

Constructor reference in java 8 This article is about constructor reference in java 8. Like a method reference we can also use constructor reference in java 8. Read more about method reference here. Now before start with example code you need to take care of few things. Constructor reference only works with Functional Interface. Read […]

Share
Continue reading →

Method references in java 8

Method references in java 8 In java 8 we can pass method references. In this article I am going to explain how to pass static and instance method reference. :: is use for passing a method reference to another method call. Example Code : In this example we are going to create one interface and […]

Share
Continue reading →

Java 8 Lambda Expression

Lambda expression is most popular topic in java 8. Lambda expression works with functional interface. Read more about functional interface here. Using Lambda expression is very easy to provide an implementation of the interface. Let’s start with one functional interface. Without Lambda Below code contains normal implementation of Car interface. Using Lambda There is only […]

Share
Continue reading →

Default Methods In Java 8

This article is about default methods in java interface. In java 8 we can declare default methods in Interface. Default Methods Default method is a method that declare with default keyword instead of abstract keyword. In Java 8 we can declare default method with it’s body in Interface. Default method is useful to provide default […]

Share
Continue reading →

Static methods in java interface – Java 8

Till java 7 static methods not supported by interface. But in java 8 we can declare static methods in interface. Example Code Car.java (Interface) Here in above code we have one interface Car with one static method printCarId();. Note : 1. Static methods must declare with body means we can not use abstract keyword with […]

Share
Continue reading →

Convert JSON To Java Object – Jackson

This article is about how to convert JSON string into Java objects. Here we are using Jackson lib to get Java Object from Json string. Add following maven dependency in your pom.xml file to add support of Jackson library in your project. Perform only two steps to get java object from JSON. 1. Create the […]

Share
Continue reading →

Convert Java Object To JSON – Jackson

This article is base on how to convert java object into JSON string. Here we are using Jackson lib to get JSON from java object. Add following maven dependency in your pom.xml file to add support of Jackson library in your project. Perform only two steps to get JSON from java object. 1. Create the […]

Share
Continue reading →