What is the output of the following code?
import java.time.LocalDate; import java.time.Month; public class Main { public static void main(String[] args) { LocalDate date = LocalDate.of(2018, Month.APRIL, 40); System.out.println(date.getYear() + " " + date.getMonth() + " " + date.getDayOfMonth()); }//from w w w .j a v a 2 s . c o m }
F.
Java throws an exception if invalid date values are passed.
There is no 40th day in April-or any other month for that matter.