Free 1Z0-809 Braindumps


  • Exam Number: 1Z0-809
  • Provider: Oracle
  • Questions: 196
  • Updated On: 25-May-2020

QUESTION: 1
Given the definition of the Vehicle class:

Class Vehhicle {
int distance; //line n1
Vehicle (int x) {
this distance = x;
}
public void increSpeed(int time) { //line n2
int timeTravel = time; //line n3
class Car {
int value = 0;
public void speed () {
value = distance /timeTravel;
System.out.println ("Velocity with new speed"+value+"kmph");
}
}
new Car().speed();
}
}

and this code fragment:

Vehicle v = new Vehicle (100);
v.increSpeed(60);

What is the result?

A. Velocity with new speed
B. A compilation error occurs at line n1.
C. A compilation error occurs at line n2.
D. A compilation error occurs at line n3.

Answer(s): A QUESTION: 2
Given:
IntStream stream = IntStream.of (1,2,3);
IntFunction<Integer> inFu= x -> y -> x*y; //line n1
IntStream newStream = stream.map(inFu.apply(10)); //line n2
newStream.forEach(System.output::print);

Which modification enables the code fragment to compile?

A. Replace line n1 with:
IntFunction<UnaryOperator> inFu = x -> y -> x*y;
B. Replace line n1 with:
IntFunction<IntUnaryOperator> inFu = x -> y -> x*y;
C. Replace line n1 with:
BiFunction<IntUnaryOperator> inFu = x -> y -> x*y;

https://Xcerts.com

Get The Premium Version

Allbraindumps.com
 Test Questions PDF from Myitguides.com

 Test Questions PDF from Myitguides.com