Java OCA OCP Practice Question 1835

Question

LocalTime.of() has a number of overloads. Which of the following is not one of them?

A.   LocalTime.of(int hour, int minute)
B.   LocalTime.of(int hour, int minute, int second)
C.   LocalTime.of(int hour, int minute, int second, int nanoOfSecond)
D.   LocalTime.of(int hour, int minute, int second, int nanoOfSecond, int picoSeconds)


D.

Note

There are three overloads for LocalTime.of().

Options A, B, and C are all valid overloads.

Option D is not because Java only allows passing one fractional second parameter.

Java does support nanoseconds, but not the further granularity of picoseconds.




PreviousNext

Related