这是我的代码(尝试为我的类编写一个复制构造函数):
public class ArgumentTree<GameArgument, Attack> extends DelegateTree<GameArgument, Attack>
{
public ArgumentTree()
{super();}
public ArgumentTree(ArgumentTree<GameArgument, Attack> sourceTree)
{
super();
Attack atck = new Attack(); // I get the Error here
more code....
}
}
Run Code Online (Sandbox Code Playgroud)
我收到此错误:
unexpected type
required: class
found: type parameter Attack
Run Code Online (Sandbox Code Playgroud)
只是为了澄清:我不想让代码通用.我已经知道我将使用的类型只是GameArgument和Attack.此外,Attack有自己适当的默认构造函数.