Consider:
public <U> void doSomethingWith(U u) {
...
}
- Method returns void
- Method gets to know the type of U when it is passed to the method
Using Java, what is <U> designed to represent?
I’d like to clarify:
Is it a kind of predeclaration “That thing of type U that’ll be passed to you that and you don’t know about .. well, it can be anything”?
Yes. It is called a generic type parameter. Read more here.