public static BTNode<E> treeCopy(BTNode<E> source)
{
if(source == null)
return null;
else
{
BTNode left = BTNode.treeCopy(source.left);
BTNode right = BTNode.treeCopy(source.right);
return new BTNode(source.data, left, right);
}
}
Run Code Online (Sandbox Code Playgroud)
我的问题是为什么我不能在静态上下文中使用泛型Type E?我试过搜索几个答案找不到任何让他们嗤之以鼻.