Everything about Java 8
As a C# developer now experimenting with Java, I still miss some things even from Java 8. Probably some have technical reasons behind, but...<p>- Getters and setters, C# style. That is, instead of<p><pre><code>    private int foo;
    public int getFoo() { return foo; }
    public void setFoo(int value) { foo = value; }
</code></pre>
write this:<p><pre><code>   public int Foo { get; set; }
</code></pre>
which is both easier to write and makes code more readable and understandable.<p>- Mandatory exception declarations in methods. I still don't understand why this is necessary. It ends up either leading to stupid errors (see the following example from the article)<p><pre><code>    void appendAll(Iterable<String> values, Appendable out)
            throws IOException { // doesn't help with the error
        values.forEach(s -> {
            out.append(s); // error: can't throw IOException here
                       // Consumer.accept(T) doesn't allow it
        });
    }
</code></pre>
, or to lots of methods just throwing Exception (bad practice, I know, but it's easy to fall in), or to useless empty try-catch on methods that won't throw an exception (because you've checked it) and don't want to add the throw declaration.<p>- Modifying external variables in a lambda expression. Just as everyone is used to in Javascript, Ruby, C#... It's pretty useful, even more when you're using lamdbas for common operations such as <i>forEach</i>.<p>- Operator overloading. When you're using data classes (for example, models from a database) where different instances actually point to the same object, overriding == it's more comfortable than <i>foo.equals(bar)</i>. Also, the downside of using <i>.equals</i> is that, if <i>foo</i> is null, you will end up with a nice NullPointerException out of nowhere.<p>- Events! I'm amazed how easy is to do events in C# versus how hard (and bloated) in Java. Take this as an example: <a href="http://scatteredcode.wordpress.com/2011/11/24/from-c-to-java-events/" rel="nofollow">http://scatteredcode.wordpress.com/2011/11/24/from-c-to-java...</a><p>- Pass by reference. Just as if you were passing a pointer in C. I find it surprising how few languages implement this feature, which is pretty useful...<p>And I'm sure I'm missing something...<p>Edit: added three bullet points.