What will be the output of the code given below?

public static void main(String[] args) {

LocalDateTime date1 = LocalDateTime.now();

System.out.println(date1.isAfter(date1.plusDays(1)));

}

False

True

Error as we cannot call plusDays() method inside another method

Nothing will get printed as isAfter() method has void as it's return type

Correct Option - a

To get all Infosys Certified Java Programmer Exam questions Join Group https://bit.ly/infy_premium_group

We're passionate about offering best placement materials and courses!! A one stop place for Placement Materials. We daily post Offcampus updates and Placement Materials.

Qtr No. 213, New Town Yehlanka Indore 454775

admin@prepflix.in