Winter Sale Special Limited Time 65% Discount Offer - Ends in 0d 00h 00m 00s - Coupon code: v4s65

1z0-808 Exam Dumps - Java SE 8 Programmer I

Go to page:
Question # 9

Given:

What is the result?

A.

Compilation fails at line n1.

B.

InitializedStartedInitialized

C.

InitializedStarted

D.

Compilation fails at line n2.

Full Access
Question # 10

This grid shows the state of a 2D array:

The grid is created with this 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 Xs?

A.

grid[2][1] = ‘X’;

B.

grid[3][2] = ‘X’;

C.

grid[3][1] = ‘X’;

D.

grid[2][3] = ‘X’;

Full Access
Question # 11

Given the code fragment:

What is the result?

A.

2 : 7 : 3

B.

7 : 7 : 9

C.

2 : 7 : 0

D.

7 : 2 : 3

Full Access
Question # 12

Given these classes:

And given this main method:

Which two options compile when placed at line n1 of the main method? (Choose two.)

A.

director.stockOptions = 1_000;

B.

employee.salary = 50_000;

C.

manager.budget = 1_000_000;

D.

manager.stockOption = 500;

E.

employee.budget = 200_000;

F.

director.salary = 80_000;

Full Access
Question # 13

Given:

What is the result?

A.

Option A

B.

Option B

C.

Option C

D.

Option D

Full Access
Question # 14

Given the code fragment:

Which code fragment, when inserted at line 9, enables the code to print true?

A.

String str2 = str1;

B.

String str2 = new String(str1);

C.

String str2 = sb1. toString();

D.

String str2 = "Duke";

Full Access
Question # 15

Which is true about the switch statement?

A.

Its expression can evaluate to a collection of values.

B.

The break statement, at the end of each case block, is optional.

C.

Its case label literals can be changed at runtime.

D.

It must contain the default section.

Full Access
Question # 16

Given these two classes:

Any amount of electricity used by a customer (represented by an instance of the Customer class) must contribute to the customer's bill (represented by the member variable bill) through the useElectricity method.

An instance of the Customer class should never be able to tamper with or decrease the value of the member variable bill.

How should you write methods in the ElectricAccount class at line n1 so that the member variable bill is always equal to the value of the member variable kwh multiplied by the member variable rate?

A.

Option A

B.

Option B

C.

Option C

D.

Option D

Full Access
Go to page: