Question: i can't find the error public void setsecond(int second) f this. second = second; 1 public String tostring() & 3 public class Main public static

public void setsecond(int second) f this. second = second; 1 public String tostring() \& 3 public class Main public static void main(String []args) f Time [] time=\{new Time (), new Time(), new Time ()) ; time [1] . sethour ( houz: 6) : time [0]. setMinute (minute: 20); System. out.println ( r: time [1].getHour ()) ; system. out. println( : time [2], getsecond ()); for (Time t:t ime) t System. out.println (x:t): 3 3 QUESTION 1 Create a class Time and complete the following parts in the class: 1. Define the class attributes (hour. minute, second). 2. Define class constructors to initialize the attributes. 3. Define all setter and getters methods for the attributes. 4. Define toString method to print the time as a single text. In the main method: 1. Create an array time using class Time. 2. Create three objects from Time inside the array. 3. Change the hour's value of time[1] to 6. 4. Change the minute's value of time[0] to 20. 5. Print out the hour's value of time[1]. 6. Print out the second's value of time[2]. 7. Print out all objects in time as strings. Attach File
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
