fundamental Code Samples
- How do I create and implement abstract class?
- How do I throw exceptions in Java?
- How do I implement interfaces in Java?
- How do I convert double value into int value?
- How do I use string in switch statement?
- How do I use the throws keyword to declare method exceptions?
- How do I overload methods in Java?
- How do I create an interface in Java?
- How do I extend classess in Java?
- How do I use the && operator in Java?
- How do I use the continue statement?
- How do I use try-with-resources statement?
- How do I use the break statement?
- How do I override a method in Java?
How do I 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 @Depreated.
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.