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

Tutoriel de base Java

Java Flow Control

Java Array

Java Object-Oriented (I)

Java Object-Oriented (II)

Java Object-Oriented (III)

Gestion des exceptions Java

Java List (List)

Java Queue (queue)

Java Map collection

Java Set collection

Java input and 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 of the deprecated API element that has been annotated.

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

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

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

Java 9 New features