1z0-809 Exam Question 1

Given:
interface Rideable {Car getCar (String name); }
class Car {
private String name;
public Car (String name) {
this.name = name;
}
}
Which code fragment creates an instance of Car?
  • 1z0-809 Exam Question 2


    What is the result?
  • 1z0-809 Exam Question 3

    Given the code fragment:
    UnaryOperator<Integer> uo1 = s -> s*2; line n1
    List<Double> loanValues = Arrays.asList(1000.0, 2000.0);
    loanValues.stream()
    .filter(lv -> lv >= 1500)
    .map(lv -> uo1.apply(lv))
    .forEach(s -> System.out.print(s + " "));
    What is the result?
  • 1z0-809 Exam Question 4

    Given:

    Given the code fragment:

    Which two sets of actions, independently, enable the code fragment to print Fit?
  • 1z0-809 Exam Question 5

    Given the code fragments:
    class MyThread implements Runnable {
    private static AtomicInteger count = new AtomicInteger (0);
    public void run () {
    int x = count.incrementAndGet();
    System.out.print (x+" ");
    }
    }
    and
    Thread thread1 = new Thread(new MyThread());
    Thread thread2 = new Thread(new MyThread());
    Thread thread3 = new Thread(new MyThread());
    Thread [] ta = {thread1, thread2, thread3};
    for (int x= 0; x < 3; x++) {
    ta[x].start();
    }
    Which statement is true?