小编BDu*_*ubs的帖子

无法从T型转换为T型?

这里使用静态工厂模式的奇怪错误.我错过了什么?这是代码:

class subclass<T> extends immutablestruct<T>{
private immutablestruct f;
private T x;

    //constructor
<T> subclass(T y, immutablestruct<T> f ){
    this.x = y;  //this is there the error is
    this.f = f;
}
Run Code Online (Sandbox Code Playgroud)

java

2
推荐指数
1
解决办法
2100
查看次数

标签 统计

java ×1