Java OCA OCP Practice Question 1809

Question

Which class has a getSeconds() method?

  • A. Only the Duration class
  • B. Only the Period class
  • C. Both the Duration and Period classes
  • D. Neither class


A.

Note

A Period is measured in days, weeks, months, or years.

A Duration is measured in smaller units like minutes or seconds.

Only Duration has a getSeconds() method, making Option A correct.




PreviousNext

Related