Home /
Expert Answers /
Computer Science /
question-9-given-the-following-uml-and-main-method-select-the-option-that-will-correctly-display-th-pa359
(Solved): Question 9 Given the following UML and main method, select the option that will correctly display th ...
Question 9
Given the following UML and main method, select the option that will correctly display the hours and minutes for Time object t. 3 4 5 public class Exercise \{ public static void main(String[] args) \{ Time t= new Time(); System.out.printlni \} Select one A A. t.hour +" " + t.minute B B. t? getHour( )+"n+t?g getMinute( ) c c. t.getHour +"n+t? getMinute D D. t.Time( ) E E. Time.getHour() + Time.getMinute()
Based on the provided UML and main method, the correct option to display the hours and minutes for the Time object t would be:B t.getHour() + " " + t.getMinute()This option calls the getHour() and getMinute() methods on the t object to retrieve the hour and minute values and then concatenates them with a space in between. The resulting string will correctly display the hours and minutes for the t object.