> 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/generic-methods.md).

# Generic Methods

This can be applied to methods:

```java
public <V> V process(final V input);
```

This example will force the input and output to be the same type.

```java
ModelObject input;
ModelObject output:
AnotherObject invalid;

input = new ModelObject();

output = process(input);

// Compilation error
invalid = process(input);
```
