Question: You are given a class named Clock with 2 attributes: hours and minutes. Write a method for this class named toString() which returns the time
You are given a class named Clock with 2 attributes: hours and minutes. Write a method for this class named toString() which returns the time as a String; for example, if hours is 12 and minutes is 30, the toString method should return 12:30; if hours is 9 and minutes is 5, it should return 9:05. Your method should not print anything. java please
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
