Home > Java > javaTutorial > How to use @Repeatable in java

How to use @Repeatable in java

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2023-05-03 13:37:06
forward
1248 people have browsed it

In Java8, through @Repeatable, the same class can be annotated multiple times.

1. Use annotation containers.

@Hints({@Hint("hint1"), @Hint("hint2")})
class Person {}
Copy after login

2. Use repeatable comments. The Java compiler can automatically set @Hint internally. This is important when reflexive reading of annotation information is required.

@Hint("hint1")
@Hint("hint2")
class Person {}
Copy after login

What collection classes are there in Java?

Collections in Java are mainly divided into four categories:

1. List list: ordered, can Repeated;

2. Queue queue: ordered, repeatable;

3. Set collection: non-repeatable;

4. Map mapping: unordered, key Unique, value is not unique.

The above is the detailed content of How to use @Repeatable in java. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Issues
Install JAVA
From 1970-01-01 08:00:00
0
0
0
Unable to install java
From 1970-01-01 08:00:00
0
0
0
Can java be used as the backend of the web?
From 1970-01-01 08:00:00
0
0
0
Is this in Java language?
From 1970-01-01 08:00:00
0
0
0
Help: JAVA encrypted data PHP decryption
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template