This is the one type of constructor. A copy constructor creates an object by copying variables from another object.
we pass one item object to the item constructor so that the new item object has the same value as the old one.
A copy constructor defined as :
public Student(Student stud)
the copy constructor is invoked by instantiating an object of type Student and passing it the object to be copied.
Student stud1=new Student(stud2);
Now, stud1 is a copy of stud2.