Question: Which expressions, when inserted at (1), will result in the following output: date2 is after date1? Select the five correct answers. (a) date2.isAfter(date1) (b) date1.isAfter(date2)

Which expressions, when inserted at (1), will result in the following output:

date2 is after date1?

import java.time. LocalDate; import java.time. Period; public class RQ11A45 { public static

Select the five correct answers.
(a) date2.isAfter(date1)
(b) date1.isAfter(date2)
(c) date2.isBefore(date1)
(d) date1.isBefore(date2)
(e) Period.between(date2, date1).isNegative()
(f) Period.between(date1, date2).isNegative()
(g) date2.until(date1).isNegative()
(h) date1.until(date2).isNegative()
(i) date1.compareTo(date2) (j) date2.compareTo(date1)

import java.time. LocalDate; import java.time. Period; public class RQ11A45 { public static void main(String[] args) { LocalDate datel = LocalDate.of (2015, 8, 19); LocalDate date2 = LocalDate.of (2015, 10, 23); if ( (1) INSERT CODE HERE */ ) { System.out.println("date2 is after datel"); } }

Step by Step Solution

3.39 Rating (158 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

a d e g and i The between and until methods return a Period which c... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Java Programming 8th Questions!