Java – what does t mean when used as a method signature? Is it a return type?

abstract public <T> T iterEdges(EdgeFun<T> func,T accum);
abstract public <T> T iterEdges(EdgeFun<T> func,T accum);

This is a multithreading library for graphics I'm not asking for anything related to the actual implementation. I just don't understand what double return type means?

I'm just guessing here, but this is my explanation (I tried Google search, but Google didn't match non alphanumeric symbols, so I tried a combination of several terms, but didn't get anywhere.)

Does it just say that it will return some kind of t-set? Two classes extend the class of this method, so I guess it allows polymorphism, but what does that mean?

Solution

It is a generic method The first is the generic type that will be used The function also declares that the return type is t. the parameter shows that they use the generic parameter type

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>