Home / 1z0-809 / Practice questions Question 46
Given the code fragment: List nums = Arrays.asList (10, 20, 8): System.out.println ( //line n1 ); Which code fragment must be inserted at line n1 to enable the code to print the maximum number in the nums list? nums.stream().max(Comparator.comparing(a -> a)).get() nums.stream().max(Integer : : max).get() nums.stream().max() nums.stream().map(a -> a).max() Question 47
Given: Which statement is true? A compilation error occurs in Cream. A compilation error occurs in Cake. A compilation error occurs in Shop. A compilation error occurs in Bread. All classes compile successfully. Question 48
Which two statements are true about localizing an application? (Choose two.) Support for new regional languages does not require recompilation of the code. Textual elements (messages and GUI labels) are hard-coded in the code. Language and region-specific programs are created using localized data. Resource bundle files include data and currency information. Language codes use lowercase letters and region codes use uppercase letters. Question 49
Which statement is true about java.util.stream.Stream? A stream cannot be consumed more than once. The execution mode of streams can be changed during processing. Streams are intended to modify the source data. A parallel stream is always faster than an equivalent sequential stream. Stream operation accepts lambda expressions as its parameters.