Return to site

☕🎓JAVA CERTIFICATION QUESTION: Time API

· java,ocp

On her birthday one August, a Java developer decided to check what day of the week her next birthday will fall on.

Given the following partial code

LocalDate birthday = LocalDate.now();
// line n1
DayOfWeek dow = birthday.getDayOfWeek();

Which two of the following could be added at line n1 to perform this calculation? Choose two.

* birthday = birthday.plus(365, ChronoUnit.DAYS);

* birthday.plus(365, ChronoUnit.DAYS);

* birthday = birthday.plus(52, ChronoUnit.WEEKS);

* birthday = birthday.plus(12, ChronoUnit.MONTHS);

* birthday = birthday.plus(1, ChronoUnit.YEARS);

* birthday.plusYears(1);

* birthday.plus(1, ChronoUnit.YEARS);

#java #certificationquestion #ocp