@Override specification changes in Java 6

In: Eclipse| Java

25 Jan 2008

Between Java 5 and Java 6 changes to the specification of @Override have been made. In Java 6 it is possible to add the @Override annotation to methods that implement methods of an interface which is not allowed in Java 5.

I noticed the difference when a friend told me that he had to remove all the @Override annotations to make his Java 6 project compile with Java 5.

The interesting thing is that there is no documentation about this change. The API specification of @Override is exactly the same in both Java versions. I found out that this was forgotten by Sun developers. Peter Ahé, a former developer at Sun, calls it the @Override Snafu.

3 Responses to @Override specification changes in Java 6

Avatar

It’s Only Software » 5 Minute Guide to Spring and Simple[r!] JDBC

March 24th, 2008 at 4:22 pm

[...] an object of the declared generic type. Here’s our PersonRowMapper implementation (Note that @Override is supported on interface implementation methods only on Java 6, so remove that annotation if you’re on Java 5): class PersonRowMapper implements [...]

Avatar

lukas

June 19th, 2009 at 9:00 am

thanks for this comment! save me time while reverting from java 6 to java 5.

Avatar

prostonik_2

March 5th, 2010 at 5:29 am

Greece announces a controversial package of tax rises and spending cuts to save 4.8bn euros and ease its budget crisis.

Comment Form

Follow Me!

Photostream

    Weihnachten 2009Saalfelden Weihnachten 2009Dodothree brothersThe Bolds 004troii Weihnachtsfeier 2009 006

RSStOMPSON's tweets