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
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 new Time(); System.out.printlni \} Select one A A. .hour " + t.minute B B. getHour( getMinute( ) c. .getHour getMinute D D. t.Time( ) E E. Time.getHour() + Time.getMinute()


We have an Answer from Expert

View Expert Answer

Expert Answer



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.
We have an Answer from Expert

Buy This Answer $5

Place Order

We Provide Services Across The Globe