How to mark method as deprecated?
To mark a method as deprecated we can use the Javadoc
@deprecated tag. This is what we did since the beginning of Java. But when a new metadata support introduced to the Java language we can also use annotation. The annotation for marking method as deprecated is
The difference between these two that the
@deprecated is place in the Javadoc comment block while the
@Deprecated is placed as a source code element.