“Java Platform, Standard Edition 8 (Java SE 8)” is released on 18th March 2014. Along with the Java SE 8 platform, the product that implements the platform, “Java SE Development Kit 8 (JDK 8)” and “Java SE Runtime Environment 8 (JRE 8)” is also released and available for download. From this release, the code name custom is discontinued and so no official code name for Java 8.
Java SE 8 is one of the most feature packed release in the Java history. In this article, let us go through the highlights of the core features of Java 8. Following list is a highlight of important features, there are other minor enhancements, security features, bug fixes are available as part of Java 8.
Lambda expressions gives the ability to pass a functionality as a method argument. Lambda expression help us reduce the code clutter in using a single method class. For example, when we have to associate an action button click to a functionality, then lambda expressions will make the code look neat and compact. Refer Java Lambda expression examples to learn more.
Pipelines and streams enrich the Java collections framework. Sequence of aggregate operations is a pipeline. Stream is used to propagate elements from a source through a pipeline. It is a sequence of elements. Pipeline and streams will make our task easier in accessing the elements from collections and applying operations on it.
Pre Java 8, date and time related operations are little bit cumbersome. JSR 310: Date and Time API give us a brand new package java.time package. This is a well thought package. It contains a best list of utility methods used for regular operations. This will help in handling date and time operations in an easier way.
Default methods gives the ability to add default implementation for methods in an interface. This is a rocking feature of Java 8. When we implement an interface, if we did not provide implementation for a method, then the default method will be used in that place. This will help in maintaining backward compatibility in applications, we can add a method to an interface without breaking its implementations.
Before Java 8 Java annotations can be applied to type declarations. From this Java 8 release onwards, annotations can be applied to type use. Annotations can be applied wherever a type is used like in new instance creates, exception throws clause etc. This will help to enforce stronger type checks and using this feature we can come up with a type checking framework itself.
Nashorn is a brand new JavaScript engine provided along with the Java 8 release. Using this we can develop standalone JavaScript applications in Java. Pre Java 8, we got JDK with a JavaScript engine based on Rhino. It is a developed from scratch. It will provide better compatibility with ECMA normalized JavaScript specification and better performance than Rhino. Already we have seen a tutorial to run Javascript in Java using the ScriptEngineManager.
java.util.concurrent.atomic package is getting additional classes as part of Java 8 release. These will help to sum values from across multiple threads.
Iterating over a collection can be done in parallel using the aggregate operations easily. Pre Java 8 Iterators are used to parse the elements of a collection one by on explicitly. Now that can be done in parallel internally with the use of streams and aggregate operations. We can create multiple substreams and those substreams can be processed internally in parallel and then the results be combined. For this to be effective, we need to have multiple cores and data volume.
The PermGen space is removed from Java 8 and instead we have MetaSpace introduced. One of the most dreaded error, “java.lang.OutOfMemoryError: PermGen error” will no longer be seen from Java 8. Nice thing is that the MetaSpace default is unlimited and that the system memory itself becomes the memory.
Server Name Indentification (SNI) is an extension of the TLS protocol used for identifying the certificate to serve based on the hostname specified by the client. This enables a server to have virtual host over HTTPS. The same IP address can be used for multiple hosts and their respective different security certificates.
The above list of Java 8 features is just a highlight. I will be writing detailed tutorials about each of them in the coming days.
Comments are closed for "Java 8 Features".
Thank you for sharing this.
Thanks. Looking forward to the articles in detail! :)
Welcome Shivang, you will get them soon :-)
Didn’t know that Java8 is released till your mail landed on my mailbox. Thanks for updates. Waiting for more info on Lambda.
Thanks alot :)
Welcome Vijendra.
Earlier, I have written couple of tutorials on Java Lambda Expressions. These tutorials will help you to get started with Lambdas in Java 8.
https://javapapers.com/core-java/lambda-expression-in-java-8/
https://javapapers.com/core-java/java-lambda-expression-examples/
Good Work Joe… Keep it up
Great overview Joe !
Good one :)
I’m curious what IDE are You using to check out Java 8 new features?
Thanks Deepak.
Dear Joe
It looks Java is fast picking up with Clojure, another JVM langauge. If Oracle has n’t done this at this stage Java would have left with as it was with earlier EJB versions. All these are in Clojure. By this Lambda act Java is both object oriented and functional language.
Thanks Joe for the updates.
With Regards
Gopinathan K M
Thanks Joe!!
It was said that PermGen space was completely removed and replaced with system memory, Then doesn’t it affect the system performace(Objects may not be garbage collected) and we cannot find out memory leaks too.
Thanks Joe very helpful.I really appreciate your passion for Java keep the good work.
Love It!
Thanks Joe , I have downloaded jdk 8 will start experimenting soon.
I love lambda feature a lot.
I am using Eclipse IDE to develop using Java 8.
You may download the latest Eclipse and it comes default with support for Java SE 8. If you are using Eclipse Kepler, you need to install a patch and it can be found at
https://wiki.eclipse.org/JDT/Eclipse_Java_8_Support_For_Kepler
No it will not affect the performance. I am working on a performance bench mark using Java 8 and Java 7. I will post that article soon.
Thanks Firoz.
Great Pratik. Post your experiences on Java 8 features.
[…] is one of the core features of Java 8. It can be used in two different modes command-line and embedded in Java applications. Generally […]
Hello Sir,I am a student studied in Hyderabad.
I Listen that the code name of Java8 is SPIDER.
Thank You..
Hello sir,My name is Panada Suraj.I am a student,studied in Hyderabad.
I Listen that the code name of Java8 is “SPIDER”.
Thank You.
Superb Joe..
[…] This Java tutorial is to give an introduction to the Stream API which is one of the core features of Java 8. […]
Nice share.Keep it up.
Hi Joe,
PermGen Space is not part of Java SE 8 specification. Metaspace is an improvement/enhancement to HotSpot JVM.
PermGen was long removed by other JVMs like Oracle JRockIt and IBM JVMs.
I thought, it would be better to differentiate the language changes, which is common to Java language and JVM changes which are specific to the provider.
Default methods gives the ability to add default implementation for methods in an interface.
So, can i say that from now we don’t requires to use abstract class.??
is it like option or replacement to abstract class ?
Thank you for sharing Java 8 features, but i want to know which are the important features among these that can be useful in our daily development for web application.
[…] Update: Permanent Generation (Permgen) space is removed from Java SE 8 features. […]
[…] memory by removing duplicate String values to a single char[] array. This option is introduced in Java 8 u […]
Nice.Keep it up.
[…] to Java 8 features, Android 5 brings in mammoth set of classes and lot of whole new packages. This will open up […]