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

Tutoriais Básicos de Java

controle de fluxo do Java

vetor do Java

Java orientado a objetos (I)

Java orientado a objetos (II)

Java orientado a objetos (III)

Tratamento de Exceções Java

Lista (List) do Java

Fila (Queue) do Java

conjunto Map do Java

conjunto Set do Java

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, which 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 the 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