Question: What will the following program print when compiled and run? Select the one correct answer. (a) The program will not compile. (b) The program will
What will the following program print when compiled and run?
![} import java.time.Period; public class RQ11A55 { public static void main (String[]](https://dsd5zvtm8ll6.cloudfront.net/images/question_images/1706/9/6/0/21965be255b41aca1706960217045.jpg)
Select the one correct answer.
(a) The program will not compile.
(b) The program will throw a runtime exception when run.
(c) The program will print P6Y26M62D.
(d) The program will print P4Y14M32D.
(e) None of the above.
} import java.time.Period; public class RQ11A55 { public static void main (String[] args) { Period pl = Period. of (1, 1, 1); Period p2 = Period. of (2, 12, 30); pl= pl.plus (p2).plus (p1); System.out.println (pl); }
Step by Step Solution
3.33 Rating (153 Votes )
There are 3 Steps involved in it
d The calculation of ... View full answer
Get step-by-step solutions from verified subject matter experts
