Tips to Pass 1z0-808 Exam (1 to 10)

1z0-808 Royal Pack Testengine pdf

100% Actual & Verified — 100% PASS

Unlimited access to the world's largest Dumps library!

Free 1z0-808 Download

Exam Code: 1z0-808 (Practice Exam Latest Test Questions VCE PDF)
Exam Name: Java SE 8 Programmer I
Certification Provider: Oracle
Free Today! Guaranteed Training- Pass 1z0-808 Exam.

2016 Jul 1z0-808 testing engine

Q1. Given: 


What is the output? 

A. 1Z0 

B. 1Z0-808 

C. An exception will be thrown. 

D. Compilation fails due to error at line 3. 

E. Compilation tails due to error at line 4. 

Answer: E 

Explanation: 

Option E is the correct answer. Code fails to compile because there is no method called concert in StringBuilder class. The concert method is in String class. Hence option E is correct Here we should have used append method of StringBuilder class, in that case option B would be correct. https://docs.oracle.com/javase/tutorial/java/data/buffers.html 


Q2. Given: 

class Base { 

// insert code here 

public class Derived extends Base{ 

public static void main(String[] args) { 

Derived obj = new Derived(); 

obj.setNum(3); 

System.out.println("Square = " + obj.getNum() * obj.getNum()); 

Which two options, when inserted independently inside class Base, ensure that the class is being properly encapsulated and allow the program to execute and print the square of the number? 

A. private int num; public int getNum() { return num; }public void setNum(int num) { this.num = num;} 

B. public int num; protected public int getNum() { return num; }protected public void setNum(int num) { this.num = num;} 

C. private int num;public int getNum() {return num;} private void setNum(int num) { this.num = num;} 

D. protected int num; public int getNum() { return num; } public void setNum(int num) { this.num = num;} 

E. protected int num; private int getNum() { return num; } public void setNum(int num) { this.num = num;} 

Answer: A,D 

Explanation: 

Incorrect: 

Not B: illegal combination of modifiers: protected and public 

not C: setNum method cannot be private. 

not E: getNum method cannot be private. 


Q3. Given: 


What is the result? 

A. 3 4 5 6 

B. 3 4 3 6 

C. 5 4 5 6 

D. 3 6 4 6 

Answer: C 


Q4. Given: 


What is the result? 

A. Red 0 

Orange 0 

Green 3 

B. Red 0 

Orange 0 

Green 6 

C. Red 0 

Orange 1 

D. Green 4 

E. Compilation fails 

Answer: E 


Q5. Given: 

package p1; 

public class Test { 

static double dvalue; 

static Test ref; 

public static void main(String[] args) { 

System.out.println(ref); 

System.out.println(dvalue); 

What is the result? 

A. p1.Test.class 

0.0 

B. <the summary address refrenced by ref> 0.000000 

C. Null 

0.0 

D. Compilation fails 

E. A NullPointerException is thrown at runtime 

Answer: C 


1z0-808  testing engine

Updated 1z0-808 exam cost:

Q6. Which two statements are true for a two-dimensional array of primitive data type? 

A. It cannot contain elements of different types. 

B. The length of each dimension must be the same. 

C. At the declaration time, the number of elements of the array in each dimension must be specified. 

D. All methods of the class object may be invoked on the two-dimensional array. 

Answer: C,D 

Explanation: http://stackoverflow.com/questions/12806739/is-an-array-a-primitive-type-or-an-object-or-something-else-entirely 


Q7. Which of the following can fill in the blank in this code to make it compile? (Select 2 options.) 


A. On line 1, fill in throws 

B. On line 1, fill in throws new 

C. On line 2, fill in throw new 

D. On line 2, fill in throws 

E. On line 2, fill in throws new 

Answer: A,C 

Explanation: 

Option A and C are the correct answer. 

In a method declaration, the keyword throws is used. So here at line 1 we have to use 

option A. 

To actually throw an exception, the keyword throw is used and a new exception is created, 

so at line 2 we have to use throw and new keywords, which is option C. Finally it will look 

like; 

public void method() throws Exception { 

throw new Exception0; 

REFERENCE : httpsy/docs.oracle.com/javase/tutorial/essential/io/fileOps.html#exception 

The correct answer is: On line 1, fill in throws. On line 2, fill in throw new 


Q8. Given: 


Which option enables the code to compile? 


A. Option A 

B. Option B 

C. Option C 

D. Option D 

Answer: C,D 


Q9. Given the code fragment 

int var1 = -5; 

int var2 = var1--; 

int var3 = 0; 

if (var2 < 0) { 

var3 = var2++; 

} else { 

var3 = --var2; 

System.out.println(var3); 

What is the result? 

A. – 6 

B. – 4 

C. – 5 

D. 5 

E. 4 

F. Compilation fails 

Answer: C 


Q10. Given: 

public class TestLoop { 

public static void main(String[] args) { 

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

int key = 3; 

for (int pos = 0; pos < array.length; ++pos) { 

if (array[pos] == key) { 

break; 

System.out.print("Found " + key + "at " + pos); 

What is the result? 

A. Found 3 at 2 

B. Found 3 at 3 

C. Compilation fails 

D. An exception is thrown at runtime 

Answer: C 

Explanation: The following line does not compile: System.out.print("Found " + key + "at " + pos); 

The variable pos is undefined at this line, as its scope is only valid in the for loop. Any variables created inside of a loop are LOCAL TO THE LOOP. 



see more 1z0-808 dumps

More 1z0-808 Certification Sample Questions and Answers: http://www.dumpsfinder.com/dumps/1z0-808