English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

Java-Grundlagen-Tutorial

Java Flow Control

Java Array

Java Object-Oriented (I)

Java Object-Oriented (II)

Java Object-Oriented (III)

Java-Exception-Verarbeitung

Java List (List)

Java Queue (Queue)

Java Map Collection

Java Set Collection

Java Input Output (I/O)/O)

Java Reader/Writer

Java Other Topics

Java 9 Improved @Deprecated Annotation

Java 9 New Features

The @Deprecated annotation can mark the status of Java API and can be one of the following:

  • There is a risk in using it, which may lead to errors

  • May be incompatible in future versions

  • May be deleted in future versions

  • A better and more efficient solution has replaced it.

Java 9 Two new elements have been added to the annotations insince and forRemoval.

  • since: The element specifies the version in which the annotated API element has been deprecated.

  • forRemoval: The element indicates that the API element of the annotation will be deleted in future versions and should be migrated to API.

The following example is Java 9 This document describes the Java Boolean class, in which the @Deprecated annotation uses the since attribute:Boolean Class.

The following example is in Java 9 This document describes the Java system classes, in which the @Deprecated annotation uses the forRemoval attribute:System Class.

Java 9 New Features