Pass the Oracle Java SE 1z0-819 Questions and answers with CertsForce

Viewing page 6 out of 9 pages
Viewing questions 51-60 out of questions
Questions # 51:

Given:

Question # 51

Which two methods facilitate valid ways to read instance fields? (Choose two.)

Options:

A.

getTCount


B.

getACount


C.

getTotalCount


D.

getCCount


E.

getGCount


Questions # 52:

Given:

Question # 52

and

Question # 52

Which code fragment on line 1 makes the s1 set contain the names of all employees born before January 1, 1989?

Question # 52

Options:

A.

Option A


B.

Option B


C.

Option C


D.

Option D


Questions # 53:

Given the code fragment:

Question # 53

Which can replace line 2?

Options:

A.

UnaryOperator u = (int i) -> i * 2;


B.

UnaryOperator u = (var i) -> (i * 2);


C.

UnaryOperator u = var i -> { return i * 2; };


D.

UnaryOperator u = i -> { return i * 2);


Questions # 54:

Given:

Question # 54

What is the result?

Options:

A.

An exception is thrown at runtime.


B.

42=(x+y)=42


C.

42=(x+y)=6


D.

6=(x+y)=42


E.

6=(x+y)=6


Questions # 55:

Given the code fragment:

Question # 55

What is the result?

Options:

A.

An ArrayIndexOutofBoundsException is thrown at runtime.


B.

The compilation fails.


C.

gh ij kl


D.

gj hk il


E.

ghi jkl


Questions # 56:

Given:

Question # 56

What is the result?

Options:

A.

Take extra care


B.

The program prints nothing.


C.

Take extra care

Take extra care


D.

An exception is thrown at runtime


Questions # 57:

A bookstore's sales are represented by a list of Sale objects populated with the name of the customer and the books they purchased.

public class Sale {

private String customer;

private List items;

// constructor, setters and getters not shown

}

public class Book {

private String name;

private double price;

// constructor, setters and getters not shown

}

Given a list of Sale objects, tList, which code fragment creates a list of total sales for each customer in ascending order?

Question # 57

Options:

A.

Option A


B.

Option B


C.

Option C


D.

Option D


Questions # 58:

Assuming the Widget class has a getPrice method, this code does not compile:

Question # 58

Which two statements, independently, would allow this code to compile? (Choose two.)

Options:

A.

Replace line 5 with widgetStream.filter(a −> ((Widget)a).getPrice() > 20.00).


B.

Replace line 1 with List widgetStream = widgets.stream();.


C.

Replace line 5 with widgetStream.filter((Widget a) −> a.getPrice() > 20.00).


D.

Replace line 4 with Stream widgetStream = widgets.stream();.


Questions # 59:

Given:

Question # 59

What is the result?

Options:

A.

6910 3


B.

10126 3


C.

3


D.

6104 3


Questions # 60:

Given:

Question # 60

Which two constructors will compile and set the class field strings? (Choose two.)

Question # 60

Options:

A.

Option A


B.

Option B


C.

Option C


D.

Option D


E.

Option E


Viewing page 6 out of 9 pages
Viewing questions 51-60 out of questions