Question: Create a DigitalClock class that extends the Clock class and has a DigitalClock(String text) constructor. This constructor takes a String in 16:34:45 format. You
Create a DigitalClock class that extends the Clock class and has a DigitalClock(String text) constructor. This constructor takes a String in "16:34:45" format. You need to do the implementation of the constructor and call it the following way: Clock clk = new DigitalClock("16:34:45"); You shall do the implementation such that, it prints 16,34 and 45 when I call clk.getHour(), clk.getMinute() and clk.getSecond(), respectively.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
