← Quiz: Date and Time in Java: all 10 questions
Quiz: Date and Time in Java · Question 7 of 10
What does this print? (code)
What does this print?
import java.time.*;
public class Main {
public static void main(String[] args) {
Duration d = Duration.between(LocalTime.of(9, 15), LocalTime.of(11, 0));
System.out.println(d.toMinutes());
}
}
- A.145
- B.1.75
- C.105
- D.75
Answer & explanation
Correct answer: 105
From 9:15 to 11:00 is 1 hour 45 minutes, which is 105 minutes.
Can you get the rest right without peeking?
Take the timed Quiz: Date and Time in Java quiz free. Pass it to earn XP and count towards your certificate.
Start the quiz →