Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Of all recent Java release, Java 5 made the largest and most obvious changes to the language. <a href="http://java.sun.com/j2se/1.5.0/docs/relnotes/features.html" rel="nofollow noreferrer">The summary</a> lists all the new features. In brief:</p> <ul> <li><a href="http://java.sun.com/j2se/1.5.0/docs/relnotes/features.html#boxing" rel="nofollow noreferrer">autoboxing</a></li> <li><a href="http://java.sun.com/j2se/1.5.0/docs/relnotes/features.html#enums" rel="nofollow noreferrer">enum</a>, e.g., <code>enum Season { WINTER, SPRING, SUMMER, FALL }</code></li> <li><a href="http://java.sun.com/j2se/1.5.0/docs/relnotes/features.html#generics" rel="nofollow noreferrer">Generics</a>, e.g., <code>Collection&lt;String&gt; coll;</code> instead of <code>Collection coll;</code></li> <li><a href="http://java.sun.com/j2se/1.5.0/docs/relnotes/features.html#forloop" rel="nofollow noreferrer">ehanced for loop</a>, e.g., <code>for (String str : coll)</code></li> <li><a href="http://java.sun.com/j2se/1.5.0/docs/relnotes/features.html#varargs" rel="nofollow noreferrer">varargs</a>, e.g., <code>private void function(Object... arguments);</code></li> <li><a href="http://java.sun.com/j2se/1.5.0/docs/relnotes/features.html#static_import" rel="nofollow noreferrer">static import</a></li> <li><a href="http://java.sun.com/j2se/1.5.0/docs/relnotes/features.html#annotations" rel="nofollow noreferrer">Annotations</a>, e.g., <code>@Override</code> or <code>@Deprecated</code></li> <li><code>String.format</code> like a Java version of <code>printf()</code></li> </ul> <p>Java 4 introduced a few new features too, primarily <a href="http://java.sun.com/j2se/1.4.2/docs/guide/lang/assert.html" rel="nofollow noreferrer">assertions</a>.</p> <p>If you prefer books, you can learn about Java 5 changes from the book <a href="http://oreilly.com/catalog/9780596007386/" rel="nofollow noreferrer">Java 5.0 Tiger: A Developer's Notebook</a>. This isn't the most comprehensive book you'll find, but it's a nice and quick introduction to all of the new features of Java 5.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload