How many lines does this program print?
import java.time.*; public class Main { public static void main(String... nums) { LocalTime time = LocalTime.of(1, 11); while (time.getHour() < 1) { time.plusHours(1); /* www. ja v a 2 s . c om*/ System.out.println("in loop"); } } }
A.
A while loop checks the condition before executing.
Since the hour is not less than one, the loop never enters, and Option A is correct.