Question: Which code, when inserted at (1), will make the program compile and execute normally? Select the three correct answers. (a) LocalTime time = LocalTime.parse(inputStr, dtf);

Which code, when inserted at (1), will make the program compile and execute

normally?

import java.time.LocalDate; import java.time.LocalDateTime; import java.time. LocalTime; import java.time.format. DateTime Formatter; public

Select the three correct answers.

(a) LocalTime time = LocalTime.parse(inputStr, dtf);

(b) LocalDate date = LocalDate.parse(inputStr, dtf);

(c) LocalDateTime dateTime = LocalDateTime.parse(inputStr, dtf);

(d) String timeStr = LocalTime.MIDNIGHT.format(dtf);

(e) String dateStr = LocalDate.of(2015, 12, 24).format(dtf);

(f) String dateTimeStr = LocalDateTime.of(2015, 12, 24, 0, 0).format(dtf);

import java.time.LocalDate; import java.time.LocalDateTime; import java.time. LocalTime; import java.time.format. DateTime Formatter; public class RQ11A85 { public static void main(String[] args) { String pattern = "'Date:' dd |MM|yyyy"; String inputStr = "Date: 02|12|2015"; DateTime Formatter dtf = DateTime Formatter.of Pattern (pattern); // (1) INSERT CODE HERE. }

Step by Step Solution

3.46 Rating (162 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

b e and f The input string matches the pattern It specifies the datebased values ... 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!