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

Ensurepass

QUESTION 1

Given:

 

clip_image002

 

What is the result?

 

A.

hEllOjAvA!

B.

Hello java!

C.

Out of limits

hEllOjAvA!

D.

Out of limits

 

Correct Answer: C

 

 

QUESTION 2

Given the code fragment:

 

clip_image004

 

Which code fragment, when inserted at line 3, enables the code to print 10:20?

 

A.

int[] array n= new int[2];

B.

int[] array;

array = int[2];

C.

int array = new int[2];

D.

int array [2] ;

 

Correct Answer: A

 

 

 

QUESTION 3

Given:

 

clip_image006

 

What is the result?

 

A.

3 4 5 6

B.

3 4 3 6

C.

5 4 5 6

D.

3 6 4 6

 

Correct Answer: C

 

 

QUESTION 4

Given:

 

clip_image008

 

What is result?

 

A.

Successful

B.

Unsuccessful

C.

Compilation fails

D.

An exception is thrown at runtime

 

Correct Answer: C

 

 

QUESTION 5

Given:

 

class Sports {

 

int num_players;

 

String name, ground_condition;

 

Sports(int np, String sname, String sground){

 

num_players = np;

 

name = sname;

 

ground_condition = sground;

 

}

 

}

 

class Cricket extends Sports {

 

int num_umpires;

 

int num_substitutes;

 

Which code fragment can be inserted at line //insert code here to enable the code to compile?

 

A.

Cricket() {

super(11, “Cricket”, “Condidtion OK”);

num_umpires =3;

num_substitutes=2;

}

B.

Cricket() {

super.ground_condition = “Condition OK”;

super.name=”Cricket”;

super.num_players = 11;

num_umpires =3;

num_substitutes=2;

}

C.

Cricket() {

this(3,2);

super(11, “Cricket”, “Condidtion OK”);

}

Cricket(int nu, ns) {

this.num_umpires =nu;

this.num_substitutes=ns;

}

D.

Cricket() {

this.num_umpires =3;

this.num_substitutes=2;

super(11, “Cricket”, “Condidtion OK”);

}

 

Correct Answer: A

Explanation:

Incorrect:

not C, not D: call to super must be the first statement in constructor.

 

 

QUESTION 6

Given:

 

clip_image010

 

What is the result?

 

A.

The sum is 2

B.

The sum is 14

C.

The sum is 15

D.

The loop executes infinite times

E.

Compilation fails

 

Correct Answer: E

 

 

QUESTION 7

Which two items can legally be contained within a java class declaration?

 

A.

An import statement

B.

A field declaration

C.

A package declaration

D.

A method declaration

 

Correct Answer: BD

Explanation:

http://docs.oracle.com/javase/tutorial/java/javaOO/methods.html

QUESTION 8

Given the code fragment:

 

clip_image012

 

What is the result?

 

A.

10 : 10

B.

5 : 5

C.

5 : 10

D.

Compilation fails

 

Correct Answer: A

 

 

QUESTION 9

int [] array = {1,2,3,4,5};

 

for (int i: array) {

 

if ( i < 2) {

 

keyword1 ;

 

}

 

System.out.println(i);

 

if ( i == 3) {

 

keyword2 ;

 

}}

 

What should keyword1 and keyword2 be respectively, in oreder to produce output 2345?

 

A.

continue, break

B.

break, break

C.

break, continue

D.

continue, continue

 

Correct Answer: D

 

 

QUESTION 10

Given the class definitions:

 

clip_image014

 

And the code fragment of the main() method,

 

clip_image015

 

What is the result?

 

A.

Java

Java

Java

B.

Java

Jeve

va

C.

Java

Jeve

ve

D.

Compilation fails

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.