Here is my class that implements the copy constructor
public class TestCopyConst { public int i=0; public TestCopyConst(TestCopyConst tcc) { this.i=tcc.i; } }
I tried to create an instance for the specified class in my main method
TestCopyConst testCopyConst = new TestCopyConst(?);
I am not sure what I should pass as a parameter. If I need to pass an instance of TestCopyConst, then again I need to switch to "new", which, in turn, will again offer a parameter
TestCopyConst testCopyConst = new TestCopyConst(new TestCopyConst(?));
what is missing here? or is the concept of a copy constructor in itself something else?
source share