Bernardo-MG / development-docs

Documentation and guidelines to help in the development of my own projects.
https://bernardo.gitbook.io/development-docs/
MIT License
0 stars 0 forks source link

Using interfaces and generics with Java #131

Closed Bernardo-MG closed 6 years ago

Bernardo-MG commented 6 years ago

How to mix interfaces and generics.

Example with a service (interface and implementation).

public interface Service<V extends ObjectInterface>

Example with a typed method:

public <V extends ObjectInterface> method(V value)

Example with wildcard:

public  method(Iterable<? extends ObjectInterface> value)