Ask Question
10 December, 11:00

A class named clock has two instance variables : hours (type int) and isticking (type boolean). write a constructor that takes a reference to an existing clock object as a parameter and copies that object 's instance variables to the object being created. your task: write a clock constructor that makes this possible. just write this constructor - - don't write the whole class or any code outside of the class!

+2
Answers (1)
  1. 10 December, 12:33
    0
    I guess you need it written in Java. So if you need only constructor, then here it is:

    public Clock (Clock clock1) {

    this. hours = clock1. hours;

    this. isTicking = clock1. isTicking;

    }

    This code is 100% correct
Know the Answer?
Not Sure About the Answer?
Find an answer to your question ✅ “A class named clock has two instance variables : hours (type int) and isticking (type boolean). write a constructor that takes a reference ...” in 📘 Computers and Technology if you're in doubt about the correctness of the answers or there's no answer, then try to use the smart search and find answers to the similar questions.
Search for Other Answers