New Year Special 70% Discount Offer - Ends in 0d 00h 00m 00s - Coupon code: save70

All 1z0-808 Test Inside Oracle Questions

Page: 8 / 17
Total 224 questions

Java SE 8 Programmer I Questions and Answers

Question 29

Given this segment of code:

Which two statements, if either were true, would make the code compile? (Choose two.)

Options:

A.

MotorCycle is an interface that implements the Cycle class.

B.

Cycle is an interface that is implemented by the MotorCycle class.

C.

Cycle is an abstract superclass of MotorCycle.

D.

Cycle and MotorCycle both extend the Transportation superclass.

E.

Cycle and MotorCycle both implement the Transportation interface.

F.

MotorCycle is a superclass of Cycle.

Question 30

Given the code fragment:

And given the requirements:

1. Process all the elements of the array in the reverse order of entry.

2. Process all the elements of the array in the order of entry.

3. Process alternating elements of the array in the order of entry.

Which two statements are true? (Choose two.)

Options:

A.

Requirements 1, 2, and 3 can be implemented by using the enhanced for loop.

B.

Requirements 1, 2, and 3 can be implemented by using the standard for loop.

C.

Requirements 2 and 3 CANNOT be implemented by using the standard for loop.

D.

Requirement 2 can be implemented by using the enhanced for loop.

E.

Requirement 3 CANNOT be implemented by using either the enhanced for loop or the standard for loop.

Question 31

Given the code fragment:

Which two modifications, when made independently, enable the code to print Joe:true: 100.0? (Choose two.)

Options:

A.

Option A

B.

Option B

C.

Option C

D.

Option D

E.

Option E

Question 32

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?

Options:

A.

Option A

B.

Option B

C.

Option C

D.

Option D

Page: 8 / 17
Total 224 questions