In this post we will provide an example on Jackson custom date serializer. Jackson is a JSON processor library for java. It allows you to convert a java POJO to and from its JSON representation along with many other things. Setup You will need to add the following dependancy

Lambda expressions are a new feature introduced in Java 8. In this post we will provide an overview of what is Lambda expressions and how to use them. Lambda Expressions What is a lambda expression A lambda expression is a way to expression a functional interface or an Interface with only one abstract method such as … Continue reading Java 8 Lambda Expressions

In this post we will explain the new feature in Java 8 Functional interface. A functional interface is an interface which only contains one abstract method but can contain default methods. Examples of an functional interface are Comparable, FileFilter and Runnable. In Java 8 and onwards, functional interfaces can be expressed using lambda expressions. Java … Continue reading Java 8 Functional Interface

In this post we will provide an example of how to print double quotes in Java. This is useful when you want to print JSON or just want to add quotes to a name or word. How to print double quotes in Java The first example adds single quotes to a String. In this example … Continue reading How to print double quotes in Java

In this post we will provide some examples on how to reverse a String in Java. Two of the three examples will use the standard Java libraries and the last will use Apache Commons. Java how to reverse a String Example 1: The first example is the most verbose solution out of the three. It loops … Continue reading Java how to reverse a String

In this post we will provide a few examples of how to quit a Java program using System.exit(). In general all Java applications will terminate once all threads have finished there executions. If for some reason you wish to terminate an application you can use System.exit(). How to quit a Java program As per documentation … Continue reading How to quit a Java program

In this post we will provide an example of how to split a string by new line in Java. How to split a string by new line The new line character is different depending on where the file was created. The list below shows the new line character for each operating system. Windows uses \r\n … Continue reading How to split a string by new line

In this post we will provide an example of how to convert a list to a CSV file in Java. This example is very simple, it uses the standard Java libraries. What is a CSV file To answer what is a CSV file, the following quote from Wikipedia puts it perfectly: In computing, a comma-separated … Continue reading How to convert a List to a CSV file

In this post we will provide an example of how to read a CSV file in Java. This example is using the standard Java libraries, so you will not need to add any external dependencies. Read a CSV file in Java We have the following CSV file, it is a list of employee information