> For the complete documentation index, see [llms.txt](https://bernardo.gitbook.io/development-docs-java/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://bernardo.gitbook.io/development-docs-java/generics/wildcards.md).

# Wildcards

If needed a wildcard generic type, which accepts any type, can be used:

```java
public void function(List<?> list);
```

```java
function(new ArrayList<String>());

function(new ArrayList<Double>());
```

## Bounds

This is an upper bounds wildcard:

```java
List<? extends Number> list;
```

Which accepts Number and it subclasses.

This is an lower bounds wildcard:

```java
List<? super Number> list;
```

Which accepts Number and it super-classes.
