Multiple Choice
Which code fragment creates a stream of lines from a file named "data.txt"?
A) try(Stream<String> linesData = Files.lines(Paths.get("data.txt") ) ) { ...};
B) try(Stream linesData = Files.lines(Paths.get("data.txt") ) ) { ...};
C) try(Stream<String> linesData = Files.lines("data.txt") ) { ...};
D) try(Stream<String> linesData = Paths.get(Files.lines("data.txt") ) ) { ...};
Correct Answer:

Verified
Correct Answer:
Verified
Q37: Complete the following statement that finds the
Q38: Assuming that the variable myStringArrayList has been
Q39: Complete the following statement that uses streams
Q40: Which statement creates a list of the
Q41: Complete the blanks in the following definition:<br>A
Q43: Which statement creates a list from a
Q44: Which statement creates a stream from an
Q45: You want to create a stream from
Q46: What does the following lambda expression do,
Q47: Complete the following code snippet that alphabetically