The largest Interview Solution Library on the web

« Previous | 1 | 2 | 3 | Next »

Jdk7 - Type Inference...

Before JDK 1.7 introduce a new operator <<, known as diamond operator to making type inference available for constructors as well.

Prior to Java 7, type inference is only available for methods, and Joshua Bloch has rightly predicted in Effective Java 2nd Edition,

it’s now available for constructor as well.

Prior JDK 7, you type more to specify types on both left and right hand side of object creation expression, but now it only needed on left hand side, as shown in below example.

So you have to type less in Java 7, while working with Collections, where we heavily use Generics.
« Previous | 1 | 2 | 3 | Next »

copyright © 2014 - all rights riserved by