Java 8 – Functional Interfaces


What are Functional Interfaces? Functional interfaces are those interfaces that has single abstract method. According to Java 8 Specification, interface can be known as functional interface if there is a single method that is compliant with the below rules: If an interface has single abstract method, then it is known as the functional interface. A functional interface can have any […]

How Much Faster Is Java 8?


Java SE 8 was released last month (March 18, 2014). Traditionally, every new major JRE version comes with a free performance boost. Do we get another free lunch? And how big is the gain this time? Let’s benchmark it. Benchmark methodology Run the same code with 3 different JRE versions (SunJDK 1.6.0_26, OpenJDK 1.7.0_51 and OpenJDK 1.8.0). The code […]

Java 8 StringJoiner Example


Java 8 introduces a new String manipulation API StringJoiner. Using StringJoiner, one can append multiple string values with the pre-defined format like commas, prefix and suffix. This syntax is very similar to the one used with the another framework Guava. StringJoiner Constructors This class takes two constructors: StringJoiner (delimiter) – Adds only the delimiter between the […]

@FunctionalInterface Annotation in Java 8


Java 8 introduces functional interfaces. If an interface has only one abstract method, then it is known as the functional interface. This can be annotated with @FunctionalInterface annotation. The following are some of the points to remember about the functional interfaces: Functional interface has only one abstract method @FunctionalInterface annotation can be used for denoting the functional […]

Java 8 Lambda Expressions Example


This tutorial highlights the benefits and method of using the Lambda expression which is new Java language feature introduced from Java 8. Lambda expressions are used for executing the methods in the functional interfaces. These are very powerful expressions to reduce the code size in the programming languages. But, it is not yet added as […]

Install Java 8 in Ubuntu


This post explains how to install Java 8 in your Ubuntu OS. If you are running Windows OS, it is straight forward to download the EXE file and install it. Even the same way you can do it for Ubuntu by loading the package. However, there is very simple and easy solution in Ubuntu is […]

Eclipse Support for Java 8


Eclipse officially announced that it supports the latest Java version Java 8 from the version Luna 4.4. However, this is not the stable version and it is in the developer downloads. If you are using the latest stable eclipse version 4.3.2, it is very simple to install the patch using the instructions provided in this […]

Java 8 Release and Features


Finally, Java 8 arrives on March 18, 2014. This release has been announced at EclipseCon 2014. It is the first major release in Java after two years of time. Java 8 comes with lot of new features which are new to the Java programming itself. From today you can download Java 8 and use it […]

@Repeatable Annotation in Java 8


There are many features in the Java 8 release. Only few of them are discussed in the blogs and few are not noticed by many developers are not advertised as it is not popularly used by the common developers. One of such feature is the introduction of @Repeatable annotation which tells the compiler that that annotation […]

Enhanced Collections API in Java 8- Supports Lambda expressions


Continuing with our exploration of JSR-335 lets look at some of the enhancements to the collections API as part of the Project Lambda effort. A new feature in the language and not supported by the existing API is just not what the programmers would want. And this is what Brian Goetz and his team working […]