1z0-819 Exam QuestionsBrowse all questions from this exam

1z0-819 Exam - Question 73


Given the content from lines.txt:

C -

C++

Java -

Go -

Kotlin -

and

What is the result?

Show Answer
Correct Answer: C

The code reads lines from a file, filters out lines that are equal to 'Java' (ignoring case), converts the remaining lines to uppercase, and collects them in a list. The input file consists of lines with content, none of which match 'Java' exactly (since they either have a '-' next to them or are completely different). Thus, none of the lines are filtered out due to ignoring case and not matching 'Java', and all lines are converted to uppercase. The resulting output will be the input lines with all characters in uppercase.

Discussion

7 comments
Sign in to comment
StavokOption: D
Jun 7, 2023

D is Correct TESTED

tmuralimanoharOption: D
Jun 29, 2023

Answer: D

OmnisumemOption: D
Sep 8, 2023

Tested.

d7bb0b2Option: D
Dec 10, 2023

D is correct because s read line by line and JAVA has a - , and is not equals to JAVA. if no have that space or - remove java from the final list

mendjijetOption: D
Feb 8, 2024

D tested JAVA # JAVA-

Galen86Option: C
Mar 12, 2024

C is the correct answer, because data that is not equal to "JAVA" is filtered line by line from the file, so there will be no JAVA in the final output.

ASPushkinOption: D
Jul 18, 2024

.filter(line -> !line.equalsIgnoreCase("JAVA") equalsIgnoreCase("JAVA") Two strings are considered equal ignoring case if they are of the same length and corresponding characters in the two strings are equal ignoring case. so all lines ARE included.