• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:

Please list down the new features of Java 8

 
Ranch Hand
Posts: 196
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Can anyone please list down the new features of Java 8?
 
Sheriff
Posts: 28383
99
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Here's a page which appears to be a summary: http://openjdk.java.net/projects/jdk8/features
 
author & internet detective
Posts: 42109
934
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
JavaFX
The New Date and Time API
Concurrency Enhancements
The Nashorn JavaScript Engine
Miscellaneous Goodies
Java 7 Features That You May Have Missed

 
Greenhorn
Posts: 2
jQuery Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.......

 
author
Posts: 284
35
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.

Cheers,

Cay
 
Jerin Joseph
Greenhorn
Posts: 2
jQuery Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

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
author
Posts: 284
35
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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 (http://processing.org/). 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.

Cheers,

Cay
 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I think this will help you

http://javahungry.blogspot.com/2013/10/oracle-java-8-new-features-lambda-expressions-optional-defender-methods-example.html
 
reply
    Bookmark Topic Watch Topic
  • New Topic