PrepZone Logo
PrepZone
Back to Java

Java · Easy

What is the diamond operator <> introduced in Java 7? How does it support type inference?

JavaCore Java

Answer preview

The diamond operator &lt;&gt; (Java 7) lets the compiler infer generic type arguments from the left-hand side context, reducing verbosity.…