String.format(Locale.US, "%02d:%02d", m, s) produces for m = 3, s = 7:

  1. 3:7
  2. 03:07
  3. 0307
  4. 3:07
Answer

B) 03:07

%02d pads numbers to two digits.

Computer Science MCQ · More Lab: Countdown Timer MCQs · Practise