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

Ensurepass

QUESTION 11

Given:

 

clip_image002

 

Which of the following is equivalent to the above code fragment?

 

A.

System.out.printLn(x>10?”>,’: “<“:,’=”);

B.

System.out.println(x>10? “>”?”<“:”=”);

C.

System.out.println(x>10?”>”:x<10?”<“:”=”);

D.

System.out.printLn(x>10?”>”?,'<“?”=”);

E.

None of the above

 

Correct Answer: B

Explanation:

Option A is incorrect as we can’t use abstract with non abstract method, (here method has method body.)

Option C is incorrect as when overriding method we can’t use more restrictive access modifier, so trying to use private to override default access Level method causes a compile time error.

Option D is incorrect as default methods (not methods with default access level) are allowed only in interfaces.

Option E is incorrect as method all ready has void as return type, so we can’t add int there. Option B is correct as we can use final there, since the method is non abstract https://docs.oracle.com/javase/tutorial/java/landl/polymorphism.html

 

 

 

 

 

 

 

 

QUESTION 12

Given the code fragment:

 

clip_image004

 

Which option represents the state of the num array after successful completion of the outer loop?

 

clip_image006

 

A.

Option A

B.

Option B

C.

Option C

D.

Option D

 

Correct Answer: A

 

 

 

 

 

 

 

 

 

 

QUESTION 13

Given:

 

clip_image008

 

What is the result?

 

A.

Marrown

String out of limits

JesOran

B.

Marrown

String out of limits

Array out of limits

C.

Marrown

String out of limits

D.

Marrown

NanRed

JesOran

 

Correct Answer: A

 

 

QUESTION 14

Given the code fragment:

 

public static void main(String[] args) {

 

int iArray[] = {65, 68, 69};

 

iArray[2] = iArray[0];

 

iArray[0] = iArray[1];

 

iArray[1] = iArray[2];

 

for (int element : iArray) {

 

System.out.print(element + ” “);

 

}

 

A.

68, 65, 69

B.

68, 65, 65

C.

65, 68, 65

D.

65, 68, 69

E.

Compilation fails

 

Correct Answer: B

 

 

QUESTION 15

Given:

 

public class Natural {

 

private int i;

 

void disp() {

 

while (i <= 5) {

 

for (int i=1; i <=5;) {

 

System.out.print(i + ” “);

 

i++;

 

}

 

i++;

 

}

 

}

 

public static void main(String[] args) {

 

new Natural().disp();

 

}

 

}

 

What is the result?

 

A.

Prints 1 2 3 4 5 once

B.

Prints 1 3 5 once

C.

Prints 1 2 3 4 5 five times

D.

Prints 1 2 3 4 5 six times

E.

Compilation fails

 

Correct Answer: D

Explanation:

1 2 3 4 5 1 2 3 4 5 1 2 3 4 5 1 2 3 4 5 1 2 3 4 5 1 2 3 4 5

 

 

QUESTION 16

Given:

 

clip_image009

 

A.

a, e

i, o

B.

a, e

o, o

C.

e, e

I, o

D.

e, e

o, o

 

Correct Answer: B

 

 

QUESTION 17

Given:

 

clip_image011

 

Which two classes use the shape class correctly?

 

clip_image013

 

A.

Option A

B.

Option B

C.

Option C

D.

Option D

E.

Option E

F.

Option F

 

Correct Answer: BE

Explanation:

When an abstract class is subclassed, the subclass usually provides implementations for all of the abstract methods in its parent class (E). However, if it does not, then the subclass must also be declared abstract (B).

Note: An abstract class is a class that is declared abstract–it may or may not include abstract methods. Abstract classes cannot be instantiated, but they can be subclassed.

 

 

 

 

 

 

 

 

 

 

 

 

 

QUESTION 18

Given the code fragment:

 

clip_image015

 

Which two modifications, when made independently, enable the code to print joe:true:100.0?

 

clip_image017

 

A.

Option A

B.

Option B

C.

Option C

D.

Option D

E.

Option E

 

Correct Answer: AC

 

 

QUESTION 19

Given the following code:

 

clip_image019

 

What are the values of each element in intArr after this code has executed?

 

A.

15, 60, 45, 90, 75

B.

15, 90, 45, 90, 75

C.

15, 30, 75, 60, 90

D.

15, 30, 90, 60, 90

E.

15, 4, 45, 60, 90

 

Correct Answer: C

 

 

QUESTION 20

Given:

 

clip_image021

What is the result?

 

A.

10:20

B.

0:20

C.

Compilation fails at line n1

D.

Compilation fails at line n2

 

Correct Answer: D

 

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.