1z1-809 Exam Questions - Real & Updated Questions PDF [Q32-Q51]

Share

1z1-809 Exam Questions - Real & Updated Questions PDF

Pass Guaranteed Quiz 2026 Realistic Verified Free Oracle


Oracle 1z1-809 exam, also known as the Java SE 8 Programmer II exam, is a certification exam designed to test the advanced programming skills of Java developers. 1z1-809 exam is intended for professionals who have already passed the Oracle Certified Associate (OCA) Java SE 8 Programmer I exam and wish to further their knowledge and skills in Java development.

 

NEW QUESTION # 32
Given:

And given the code fragment:

What is the result?

  • A. Compilation fails.
  • B. C2C2
  • C. C1C2
  • D. C1C1

Answer: A


NEW QUESTION # 33
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?

  • A. Boarddoes not compile.
  • B. Drawabledoes not compile.
  • C. Framedoes not compile.
  • D. All classes compile successfully.
  • E. Paperdoes not compile.

Answer: E


NEW QUESTION # 34
The following grid shows the state of a 2D array:

This grid is created with the following code:

Which line of code, when inserted in place of //line n1. adds an x into the grid so that the grid contains three consecutive X'S?

  • A. qrid [3] [1] = 'X' ;
  • B. qrid [0] [2] = 'X' ;
  • C. qrid [1] [2] = 'X' ;
  • D. qrid [1] [3] = 'X' ;
  • E. qrid [2] [0] = 'X' ;

Answer: E


NEW QUESTION # 35
Given:

And given the code fragment:

  • A. Compilation fails at both line n1 and line n2.
  • B. Compilation fails only at line n2.
  • C. Compilation fails only at line n1.
  • D. 4W 100 Auto
    4W 150 Manual
  • E. null 0 Auto
    4W 150 Manual

Answer: B


NEW QUESTION # 36
Given the code fragment:

What is the result ?
[X]

  • A. [X, X]
    [X, X, X]
    [X, X]
  • B. [X, X]
    [X, X, X]
    [X, X, X, X]
    [X, X]
  • C. [X]
  • D. [X, X, X, X]

Answer: B


NEW QUESTION # 37
Given the code fragment:

What is the result?

  • A. A compilation error occurs.
  • B. [Java, J2EE, J2ME, JSTL]
  • C. [Java, J2EE, J2ME, JSTL, JSP]
  • D. null

Answer: B


NEW QUESTION # 38
Given the code fragments:
public class Book implements Comparator<Book> {
String name;
double price;
public Book () {}
public Book(String name, double price) {
this.name = name;
this.price = price;
}
public int compare(Book b1, Book b2) {
return b1.name.compareTo(b2.name);
}
public String toString() {
return name + ":" + price;
}
}
and
List<Book>books = Arrays.asList (new Book ("Beginning with Java", 2), new book ("A Guide to Java Tour", 3)); Collections.sort(books, new Book()); System.out.print(books); What is the result?

  • A. An Exception is thrown at run time.
  • B. A compilation error occurs because the Book class does not override the abstract method compareTo().
  • C. [Beginning with Java:2, A Guide to Java Tour:3]
  • D. [A Guide to Java Tour:3.0, Beginning with Java:2.0]

Answer: D


NEW QUESTION # 39
Given the code fragments :

and

What is the result?

  • A. A compilation error occurs.
  • B. TV Price :1000 Refrigerator Price :2000
  • C. TV Price :110 Refrigerator Price :2100
  • D. The program prints nothing.

Answer: C


NEW QUESTION # 40
Given:
public class Emp {
String fName;
String lName;
public Emp (String fn, String ln) {
fName = fn;
lName = ln;
}
public String getfName() { return fName; }
public String getlName() { return lName; }
}
and the code fragment:
List<Emp> emp = Arrays.asList (
new Emp ("John", "Smith"),
new Emp ("Peter", "Sam"),
new Emp ("Thomas", "Wale"));
emp.stream()
//line n1
.collect(Collectors.toList());
Which code fragment, when inserted at line n1, sorts the employees list in descending order of fName and then ascending order of lName?

  • A. .map(Emp::getfName).sorted(Comparator.reserveOrder())
  • B. .sorted (Comparator.comparing(Emp::getfName).reserved().thenComparing(Emp::getlName))
  • C. .sorted (Comparator.comparing(Emp::getfName).thenComparing(Emp::getlName))
  • D. .map(Emp::getfName).sorted(Comparator.reserveOrder().map(Emp::getlName).reserved

Answer: B


NEW QUESTION # 41
Given the code fragments:
class ThreadRunner implements Runnable {
public void run () { System.out.print ("Runnable") ; }
}
class ThreadCaller implements Callable {
Public String call () throws Exception {return "Callable"; )
}
and
ExecutorService es = Executors.newCachedThreadPool ();
Runnable r1 = new ThreadRunner ();
Callable c1 = new ThreadCaller ();
// line n1
es.shutdown();
Which code fragment can be inserted at line n1to start r1and c1 threads?

  • A. Future<String> f1 = (Future<String>) es.submit (r1);
    es.execute (c1);
  • B. es.execute (r1);
    Future<String> f1 = es.execute (c1) ;
  • C. es.submit(r1);
    Future<String> f1 = es.submit (c1);
  • D. Future<String> f1 = (Future<String>) es.execute(r1);
    Future<String> f2 = (Future<String>) es.execute(c1);

Answer: C


NEW QUESTION # 42
Given the content of Operator.java, EngineOperator.java,and Engine.javafiles:

and the code fragment:

What is the result?

  • A. The Operator.javafile fails to compile.
  • B. The Engine.javafile fails to compile.
  • C. ON OFF
  • D. The EngineOperator.javafile fails to compile.

Answer: B


NEW QUESTION # 43
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?
1John2null

  • A. 0
  • B.
  • C. A NullPointerExceptionis thrown at run time.
  • D. A compilation error occurs.

Answer: D


NEW QUESTION # 44
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. A compilation error occurs at line n1.
  • B. Velocity with new speed 1 kmph
  • C. A compilation error occurs at line n3.
  • D. A compilation error occurs at line n2.

Answer: C


NEW QUESTION # 45
Given the definition of the Emp class:
public class Emp
private String eName;
private Integer eAge;
Emp(String eN, Integer eA) {
this.eName = eN;
this.eAge = eA;
}
public Integer getEAge () {return eAge;}
public String getEName () {return eName;}
}
and code fragment:
List<Emp>li = Arrays.asList(new Emp("Sam", 20), New Emp("John", 60),
New Emp("Jim",
51));
Predicate<Emp> agVal = s -> s.getEAge() > 50;//line n1
li = li.stream().filter(agVal).collect(Collectors.toList());
Stream<String> names = li.stream()map.(Emp::getEName);//line n2
names.forEach(n -> System.out.print(n + " "));
What is the result?

  • A. A compilation error occurs at line n1.
  • B. John Jim
  • C. Sam John Jim
  • D. A compilation error occurs at line n2.

Answer: B


NEW QUESTION # 46
Which two statements are true about the Fork/Join Framework? (Choose two.)

  • A. The Fork/Join framework implements a work-stealing algorithm.
  • B. The Fork/Join framework can help you take advantage of multicore hardware.
  • C. The Fork/Join solution when run on multicore hardware always performs faster than standard sequential solution.
  • D. The RecursiveTask subclass is used when a task does not need to return a result.

Answer: A,D


NEW QUESTION # 47
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<Student> 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))
.forEach(src, res) -> System.out.println(scr));
What is the result?
[Java EE: Helen:Houston]

  • A. [Java EE: Helen:Houston]
  • B. A compilation error occurs.
  • C. Java ME
    [Java ME: Jessy:Chicago, Java ME: Mark:Chicago]
  • D. [Java ME: Jessy:Chicago, Java ME: Mark:Chicago]
    Java EE

Answer: C


NEW QUESTION # 48
Given:
class Book {
int id;
String name;
public Book (int id, String name) {
this.id = id;
this.name = name;
}
public boolean equals (Object obj) { //line n1
boolean output = false;
Book b = (Book) obj;
if (this.name.equals(b name))}
output = true;
}
return output;
}
}
and the code fragment:
Book b1 = new Book (101, "Java Programing");
Book b2 = new Book (102, "Java Programing");
System.out.println (b1.equals(b2)); //line n2
Which statement is true?

  • A. The program prints true.
  • B. The program prints false.
  • C. A compilation error occurs. To ensure successful compilation, replace line n2 with:System.out.println (b1.equals((Object) b2));
  • D. A compilation error occurs. To ensure successful compilation, replace line n1 with:boolean equals (Book obj) {

Answer: A


NEW QUESTION # 49
Given the code fragment:

Which code fragment, when inserted at line n1, enables the code to print /First.txt?

  • A. Path iP = new Paths ("/First.txt");
  • B. Path iP = Paths.get ("/", "First.txt");
  • C. Path iP = Paths.toPath ("/First.txt");
  • D. Path iP = new Path ("/First.txt");

Answer: B


NEW QUESTION # 50
Given:
public class Emp {
String fName;
String lName;
public Emp (String fn, String ln) {
fName = fn;
lName = ln;
}
public String getfName() { return fName; }
public String getlName() { return lName; }
}
and the code fragment:
List<Emp> emp = Arrays.asList (
new Emp ("John", "Smith"),
new Emp ("Peter", "Sam"),
new Emp ("Thomas", "Wale"));
emp.stream()
//line n1
.collect(Collectors.toList());
Which code fragment, when inserted at line n1, sorts the employees list in descending order of fName and then
ascending order of lName?

  • A. .map(Emp::getfName).sorted(Comparator.reserveOrder())
  • B. .sorted (Comparator.comparing(Emp::getfName).reserved().thenComparing(Emp::getlName))
  • C. .sorted (Comparator.comparing(Emp::getfName).thenComparing(Emp::getlName))
  • D. .map(Emp::getfName).sorted(Comparator.reserveOrder().map(Emp::getlName).reserved

Answer: C


NEW QUESTION # 51
......

Get to the Top with 1z1-809 Practice Exam Questions: https://www.suretorrent.com/1z1-809-exam-guide-torrent.html

Free Java SE 1z1-809 Ultimate Study Guide: https://drive.google.com/open?id=1jJ-JrW9i6rAFyus744BAPgsZF1D17V12