Download Oracle.1z0-809.PracticeTest.2018-08-01.48q.tqb

Vendor: Oracle
Exam Code: 1z0-809
Exam Name: Java SE 8 Programmer II
Date: Aug 01, 2018
File Size: 304 KB

Demo Questions

Question 1
Given:
public class Foo<K, V>   { 
    private K key; 
    private V value; 
public Foo (K key, V value) (this.key = key; this value = value;) 
public static <T> Foo<T, T> twice (T value) (return new Foo<T, T> (value, value); ) 
public K getKey () (return key;) 
public V getValue () (return value;) 
Which option fails?
  1. Foo<String, Integer> mark = new Foo<String, Integer> (“Steve”, 100);); 
  2. Foo<String, String> pair = Foo.<String>twice (“Hello World!”);
  3. Foo percentage = new Foo(97, 32);
  4. Foo<String, String> grade = new Foo <> (“John”, “A”);
Correct answer: C
Question 2
Given the code fragment:
Stream<List<String>> iStr= Stream.of ( 
    Arrays.asList (“1”, “John”), 
    Arrays.asList (“2”, null)0; 
Stream<<String> nInSt = iStr.flatMapToInt ((x) -> x.stream ()); 
nInSt.forEach (System.out :: print);
What is the result? 
  1. 1John2null
  2. 12
  3. A NullPointerException is thrown at run time.
  4. A compilation error occurs.
Correct answer: D
Question 3
Given the code fragment:
Path file = Paths.get (“courses.txt”); 
// line n1 
Assume the courses.txt is accessible. 
Which code fragment can be inserted at line n1 to enable the code to print the content of the courses.txt file? 
  1. List<String> fc = Files.list(file);
    fc.stream().forEach (s - > System.out.println(s));
  2. Stream<String> fc = Files.readAllLines (file);
    fc.forEach (s - > System.out.println(s));
  3. List<String> fc = readAllLines(file);
    fc.stream().forEach (s - > System.out.println(s));
  4. Stream<String> fc = Files.lines (file);
    fc.forEach (s - > System.out.println(s));
Correct answer: D
EXAM SIMULATOR

How to Open TQB Files?

Use Taurus Exam Simulator to open TQB files

Taurus Exam Simulator


Taurus Exam Simulator for Windows/macOS/Linus

Download

Taurus Exam Studio
Enjoy a 20% discount on Taurus Exam Studio!

You now have the chance to acquire Exam Studio at a discounted rate of 20%.

Get Now!
-->