Answer:
The following are the code for the constructor.
public Clock (Clock c) //define constructor
{
hours = c.hours; // holding the value in the hour variable
isTicking = c.isTicking;// holding the value in the hour variable
}
Step-by-step explanation:
The following are the description of the code.
- Firstly, we define the constructor 'Clock()' because the constructor name is the same as the class name and declares the object of the class that is 'c' in the parameter of the constructor.
- Finally, copies the instance variables (which are already declared) of the object to that object that is formed.