[Free] Download New Updated (October 2016) Oracle 1Z0-808 Real Exam 41-50

Ensurepass

QUESTION 41

You are asked to develop a program for a shopping application, and you are given the following information:

 

The application must contain the classes Toy, EduToy, and consToy. The Toy class is the superclass of the other two classes. The int caicuiatePrice (Toy t) method calculates the price of a toy. The void printToy (Toy t) method prints the details of a toy.

 

Which definition of the Toy class adds a valid layer of abstraction to the class hierarchy?

 

clip_image002

 

A.

Option A

B.

Option B

C.

Option C

D.

Option D

 

Correct Answer: A

 

 

QUESTION 42

Given:

 

clip_image004

 

What is the result?

 

A.

Base

DerivedA

B.

Base

DerivedB

C.

DerivedB

DerivedB

D.

DerivedB

DerivedA

E.

A classcast Except ion is thrown at runtime.

 

Correct Answer: C

 

 

QUESTION 43

Given:

 

clip_image006

 

What is the result?

 

clip_image008

A.

Option A

B.

Option B

C.

Option C

D.

Option D

 

Correct Answer: B

 

 

QUESTION 44

Given:

 

clip_image010

 

What is the result?

 

A.

11, 21, 31, 11, 21, 31

B.

11, 21, 31, 12, 22, 32

C.

12, 22, 32, 12, 22, 32

D.

10, 20, 30, 10, 20, 30

 

Correct Answer: D

 

 

QUESTION 45

Given:

 

clip_image011

 

What is the output?

 

A.

[21, 13, 11]

B.

[30]

C.

[]

D.

Compilation fails due to error at line 7

E.

Compilation tails due to error at line 10

 

Correct Answer: D

Explanation:

Option D is the correct answer.

Code fails to compile as we can’t use primitive for collections type, so in this code trying to use int at line 7, causes a compile error. We should have use wrapper. Integer there. So option D is correct.

https://docs.oracle.eom/javase/8/docs/api/java/util/ArrayList.html

 

 

QUESTION 46

Given:

 

clip_image013

 

Which code fragment should you use at line n1 to instantiate the dvd object successfully?

 

clip_image015

 

A.

Option A

B.

Option B

C.

Option C

D.

Option D

 

Correct Answer: C

 

 

QUESTION 47

Given the following classes:

 

clip_image017

 

Which two options fail to compile when placed at line n1 of the main method?

 

A.

employee.salary = 50_000;

B.

director.salary = 80_000;

C.

employee.budget = 200_000;

D.

manager.budget = 1_000_000;

E.

manager.stockOption = 500;

F.

director.stockOptions = 1_000;

 

Correct Answer: CE

 

 

 

 

 

 

 

 

QUESTION 48

Given the code fragment:

 

clip_image019

 

What is the result?

 

A.

Sum is 600

B.

Compilation fails at line n1.

C.

Compilation fails at line n2.

D.

A ClassCastException is thrown at line n1.

E.

A ClassCastException is thrown at line n2.

 

Correct Answer: C

 

 

QUESTION 49

Which two are valid array declaration?

 

A.

Object array[];

B.

Boolean array[3];

C.

int[] array;

D.

Float[2] array;

 

Correct Answer: AC

 

 

QUESTION 50

Given the code fragment from three files:

 

clip_image020

Which code fragment, when inserted at line 2, enables the code to compile?

 

clip_image022

 

A.

Option A

B.

Option B

C.

Option C

D.

Option D

E.

Option E

 

Correct Answer: E

 

Free VCE & PDF File for Oracle 1Z0-808 Real Exam

Instant Access to Free VCE Files: CompTIA | VMware | SAP …
Instant Access to Free PDF Files: CompTIA | VMware | SAP …

This entry was posted in 1Z0-808 Actual Test (October 2016) and tagged , , , , , , , . Bookmark the permalink.