Get the App
SLTechnology News&Howtos  ›  Internet Technology  › 

How to use java lower-bound wildcards

Shulou Source: shulou.com Published: 2022-05-31 10:53:00 10月03日 Update

Most people do not understand the knowledge points of this article "how to use java lower-bound wildcards", so the editor summarizes the following content, detailed content, clear steps, and has a certain reference value. I hope you can get something after reading this article. Let's take a look at this "java lower-bound wildcard how to use" article.

Description

1. Lower-bound wildcards restrict unknown types to specific types or supertypes.

2. Lower-bound wildcards use wildcards ('?').

It is followed by the super keyword, followed by its lower limit.

< ?super A >

.

3. The class instantiated by the wildcard must be the current class or the superclass of the current class.

When storing data, the data type can only be the current class or a superclass of the current class.

Example

Public static void addNumbers (List

Tags: Wildcards content lower bounds types order lower bounds examples data articles knowledge articles values keys keywords most that is more steps knowledge points industries Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno MariaDB vpn Xiaomi OPPO Reno NVidia