my dog learned polymorphism
The moose likes Features new in Java 8 and the fly likes Please list down the new features of Java 8 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Features new in Java 8
Bookmark "Please list down the new features of Java 8 " Watch "Please list down the new features of Java 8 " New topic

Please list down the new features of Java 8

Awais Bajwa
Ranch Hand

Joined: Jan 16, 2001
Posts: 191
Can anyone please list down the new features of Java 8?
Paul Clapham

Joined: Oct 14, 2005
Posts: 19973

Here's a page which appears to be a summary:
Jeanne Boyarsky
author & internet detective

Joined: May 26, 2003
Posts: 33107

The table of contents of Java 8 for the Really Impatient lists features concisely:

Table of Contents

Lambda Expressions
The Stream API
Programming with Lambdas
The New Date and Time API
Concurrency Enhancements
The Nashorn JavaScript Engine
Miscellaneous Goodies
Java 7 Features That You May Have Missed

[OCA 8 book] [Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Other Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, TOGAF part 1 and part 2
Jerin Joseph

Joined: May 04, 2012
Posts: 2

Hi the most important things that most would be probably using will be.

1. Defender Methods - Concrete Methods in the Interface !! (This is really cool) you can actually write implemented methods in an Interface.
2. Stream API
3. Lambda Expressions - You will be using this together with the Stream API if you want to use the multi core features. The syntax will take some time to burn in but its really worth it

I am no expert in these things but I believe some one can explain this in more detail over here.......

Cay Horstmann
Ranch Hand

Joined: Nov 14, 2004
Posts: 137
The big Java 8 feature is of course lambdas with all its ramifications (method references, default and static methods in interfaces, streams). That's about 1/3 of my book.

There is a new date/time API that is very nice--you'll never want to use GregorianCalendar again.

If you care about this, there is a high-quality embeddable JavaScript implementation that interoperates with Java. Just last week, in a project on which I am working, we needed some degree of end-user customizability and were about to design some configuration language. Then we realized we could just let the users specify the customizations in JavaScript.

If you still do rich GUI clients, you will want to know about JavaFX. It comes automatically bundled with Java 8, as Swing is now in "maintenance mode".

There are concurrency enhancements, mostly for advanced users. For example, it is now easy to make threadsafe maps of counters. (This used to be surprisingly painful.)

And of course, there are a bunch of minor changes (easy string joining, a mod method with sane behavior for negative inputs, official support for Base64 encoding, etc.) I searched through the source tree and collected the useful nuggets so you wouldn't have to.



Author of Java 8 for the Really Impatient
Jerin Joseph

Joined: May 04, 2012
Posts: 2


Can I use Java FX for client side scripting ??
And can you provide more detail on how to link javascript to java code.
Is it something like the GWT where in compile time the code gets converted to javascript ?
Cay Horstmann
Ranch Hand

Joined: Nov 14, 2004
Posts: 137
JavaFX no longer has its own scripting language. You write the code in Java, but you get the JavaFX components, shapes, etc.

Nashorn is nothing like GWT. It is pure JavaScript, but with extensions to manipulate Java objects. It's meant for end-user programmability, kind of like VBScript in MS Office. You expose some Java objects and then run the user's script which manipulates them. The idea is that more users will be comfortable with JavaScript. They don't need to compile anything or know how to read javadoc.

In fact, you can write JavaFX programs in Nashorn. It's not as convenient as the JavaFX Script language used to be, but it could be pretty close if someone worked at imitating the old builder syntax with nested JS objects.

In general, there are too many custom languages. Look at Processing ( The graphics are great. But having to learn yet another small language, designed by well-meaning amateurs, is annoying. They didn't think a Java API would work for their user base, and I can agree with that. If they had then what we have now, they could just expose an API to JavaScript (just like the DOM API is exposed in a browser). JavaScript may not be wonderful, but it isn't terrible either, and the investment of mastering its quirks pays off elsewhere. So, if your project needs end-user scripting, check out Nashorn.


Navnish Agarwal

Joined: Feb 10, 2014
Posts: 3
I think this will help you
I agree. Here's the link:
subject: Please list down the new features of Java 8
It's not a secret anymore!