
Classes and Objects • 171
System.out.println(“++++++++++++++++++++++++++”);
time3.show_time(“Sum of two duration is “);
System.out.println(“**********************\n\n”);
}
}
OUTPUT:
+++++++++++++++++++++++++++++++++++++++++++++
Time 1
Hours = 3 Minutes = 34 Seconds=45
*********************************************
Time 2
Hours = 4 Minutes = 26 Seconds=55
+++++++++++++++++++++++++++++++++++++++++++++
Sum of two duration is
Hours = 8 Minutes = 1 Seconds=40
*********************************************
Explanation: In the program, the sum of two time durations is found. The function declaration time sum_
time (time A, time ...