相关疑难解决方法(0)

Java函数声明中<T,U扩展T>的含义

我看到了这个:

public static <T,U extends T> AutoBean<T> getAutoBean(U delegate)
Run Code Online (Sandbox Code Playgroud)

我知道输入类是U类型,而AutoBean类是T类型,而U扩展T是边界。但是,这<T,是什么意思呢?

Also, if I am going to write a function to accept the output of getAutoBean, how would you write the function declaration? (i.e. myFunction(getAutoBean(...)), what will the function declaration of myFunction() be?)

Thank you!

java generics methods

5
推荐指数
1
解决办法
3175
查看次数

标签 统计

generics ×1

java ×1

methods ×1