Write the definition of a class Clock. The class has no constructors and three instance variables. One is of type int called hours, another is of type boolean called isTicking, and the last one is of type Integer called diff.

Write the definition of a class Clock. The class  has no constructors and three instance variables. One is of type int  called hours, another is of type boolean called isTicking, and the last one is of type Integer called diff.

LANGUAGE: JAVA

CHALLENGE:

Write the definition of a class Clock. The class has no constructors and three instance variables. One is of type int called hours, another is of type boolean called isTicking, and the last one is of type Integer called diff.

SOLUTION:

public class Clock {
   private int hours;
   private boolean isTicking;
   private Integer diff;
}

Add comment