这是我实现复制构造函数的类
public class TestCopyConst
{
public int i=0;
public TestCopyConst(TestCopyConst tcc)
{
this.i=tcc.i;
}
}
我试图在我的主要方法中为上述类创建一个实例
TestCopyConst testCopyConst = new TestCopyConst(?);
我不确定我应该作为参数传递什么。如果我必须传递一个 TestCopyConst 的实例,那么我必须再次选择“new”,这又会再次提示输入参数
TestCopyConst testCopyConst = new TestCopyConst(new TestCopyConst(?));
这里缺少什么?或者复制构造函数的概念本身是不同的?