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

Ensurepass

QUESTION 71

Given the following four Java file definitions:

 

// Foo.java

 

package facades;

 

public interface Foo { }

 

// Boo.java

 

package facades;

 

public interface Boo extends Foo { }

 

// Woofy.java

 

package org.domain

 

// line n1

public class Woofy implements Boo, Foo { }

 

// Test.java

 

package.org;

 

public class Test {

 

public static void main(String[] args) {

 

Foo obj=new Woofy();

 

Which set modifications enable the code to compile and run?

 

A.

At line n1, Insert: import facades; At line n2, insert:import facades;import org.domain;

B.

At line n1, Insert: import facades.*; At line n2, insert:import facades;import org.*;

C.

At line n1, Insert: import facades.*; At line n2, insert:import facades.Boo;import org.*;

D.

At line n1, Inse
rt: import facades.Foo, Boo; At line n2, insert:import org.domain.Woofy;

E.

At line n1, Insert: import facades.*; At line n2, insert:import facades;import org.domain.Woofy;

 

Correct Answer: E

 

 

QUESTION 72

Given the code fragment:

 

StringBuilder sb = new StringBuilder ( ) ;

 

Sb.append (“world”);

 

Which code fragment prints Hello World?

 

A.

sb.insert(0,”Hello “);

System.out.println(sb);

B.

sb.append(0,”Hello “);

System.out.println(sb);

C.

sb.add(0,”Hello “);

System.out.println(sb);

D.

sb.set(0,”Hello “);

System.out.println(sb);D

 

Correct Answer: A

Explanation:

The java.lang.StringBuilder.insert(int offset, char c) method inserts the string representation of the char argument into this sequence. The second argument is inserted into the contents of this sequence at the position indicated by offset. The length of this sequence increases by one.The offset argument must be greater than or equal to 0, and less than or equal to the length of this sequence.

Reference: Java.lang.StringBuilder.insert() Method

 

 

 

 

 

QUESTION 73

Given the fragments:

 

clip_image001

 

Which line causes a compilation error?

 

A.

Line n1

B.

Line n2

C.

Line n3

D.

Line n4

 

Correct Answer: A

&nb
sp;

 

QUESTION 74

Given:

 

public class ScopeTest {

 

int j, int k;

 

public static void main(String[] args) {

 

ew ScopeTest().doStuff(); }

 

void doStuff() {

 

nt x = 5;

 

oStuff2();

 

System.out.println(“x”);

 

 

}

 

void doStuff2() {

 

nt y = 7;

 

ystem.out.println(“y”);

 

or (int z = 0; z < 5; z++) {

 

ystem.out.println(“z”);

 

ystem.out.println(“y”);

 

}

 

Which two items are fields?

 

A.

j

B.

k

C.

x

D.

y

E.

z

 

Correct Answer: AB

 

 

QUESTION 75

Given:

 

clip_image003

 

What is the result?

A.

97 98

99 100 null null null

B.

91 98

99 100 101 102 103

C.

Compilation rails.

D.

A NullPointerException is thrown at runtime.

E.

An ArraylndexOutOfBoundsException is thrown at runtime.

 

Correct Answer: A

 

 

QUESTION 76

Given the code fragment:

 

clip_image005

 

What is the result?

 

A.

Reading Card

Checking Card

B.

Compilation fails only at line n1.

C.

Compilation fails only at line n2.

D.

Compilation fails only at line n3.

E.

Compilation fails at both line n2 and line n3.

 

Correct Answer: D

 

 

 

 

 

 

 

 

 

 

 

 

QUESTION 77

Given the code fragment

 

clip_image006

 

Which code fragments, inserted independently, enable the code compile?

 

A.

t.fvar = 200;

B.

cvar = 400;

C.

fvar = 200;

cvar = 400;

D.

this.fvar = 200;

this.cvar = 400;

E.

t.fvar = 200;

Test2.cvar = 400;

F.

this.fvar = 200;

Test2.cvar = 400;

 

Correct Answer: B

 

 

QUESTION 78

Given:

 

clip_image008

 

What is the result?

 

A.

0

Done

B.

First Exception

Done

C.

Second Exception

D.

Done

< span lang="EN-US" style="font-family: ; mso-font-kerning: 0pt; mso-no-proof: yes">Third Exception

E.

Third Exception

 

Correct Answer: B

 

 

QUESTION 79

Given:

 

abstract class A1 {

 

public abstract void m1();

 

public void m2() { System.out.println(“Green”); }

 

}

 

abstract class A2 extends A1 {

 

public abstract void m3();

 

public void m1() { System.out.println(“Cyan”); }

 

public void m2() { System.out.println(“Blue”); }

 

}

 

public class A3 extends A2 {

 

public void m1() { System.out.println(“Yellow”); }

 

public void m2() { System.out.println(“Pink”); }

 

public void m3() { System.out.println(“Red”); }

 

public static void main(String[] args) {

 

A2 tp = new A3();

 

tp.m1();

 

tp.m2();

 

tp.m3();

 

}

 

}

 

What is the result?

 

A.

Yellow

Pink

Red

B.

Cyan

Blue

Red

C.

Cyan

Green

Red

D.

Compilation Fails

 

Correct Answer: A

 

 

QUESTION 80

Given:

 

clip_image010

 

What is the result?

 

A.

C B A

B.

C

C.

A B C

D.

Compilation fails at line n1 and line n2

 

Correct Answer: C

 

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.