1Z0-809 Dumps

1Z0-809 Free Practice Test

Oracle 1Z0-809: Java SE 8 Programmer II

QUESTION 51

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?

Correct Answer: A

QUESTION 52

Given:
class Student {
String course, name, city;
public Student (String name, String course, String city) { this.course = course; this.name = name; this.city = city;
}
public String toString() {
return course + “:” + name + “:” + city;
}
and the code fragment: List stds = Arrays.asList(
new Student (“Jessy”, “Java ME”, “Chicago”), new Student (“Helen”, “Java EE”, “Houston”), new Student (“Mark”, “Java ME”, “Chicago”)); stds.stream()
.collect(Collectors.groupingBy(Student::getCourse))
.f orEach(src, res) -> System.out.println(scr)); What is the result?

Correct Answer: B

QUESTION 53

Given the content:
< ><>>< ><>

Correct Answer: B

QUESTION 54

Given:
< ><>>< ><>

Correct Answer: C

QUESTION 55

Given:
public class Canvas implements Drawable { public void draw () { }
}
public abstract class Board extends Canvas { }
public class Paper extends Canvas { protected void draw (int color) { }
}
public class Frame extends Canvas implements Drawable { public void resize () { }
}
public interface Drawable { public abstract void draw ();
}
Which statement is true?

Correct Answer: E