You will get the actual detailed description whenever you deal with difficulties during your 1z0-808 study. Examcollection give you the actual 1z0-808 Java SE 8 Programmer I tips legibly inside the 1z0-808 puts. These types of greatly saving your costs to get acquainted with the actual Oracle training courses.

2016 Oct 1z0-808 exam cram

Q151. Given the code fragment: 

Which two modifications should you make so that the code compiles successfully? 

A. Option A 

B. Option B 

C. Option C 

D. Option D 

E. Option E 

Answer: A,C 

Explanation: 

Add throws clause in both printFileContent and main. 


Q152. View the exhibit: 

public class Student { 

public String name = ""; 

public int age = 0; 

public String major = "Undeclared"; 

public boolean fulltime = true; 

public void display() { 

System.out.println("Name: " + name + " Major: " + major); } 

public boolean isFullTime() { 

return fulltime; 

Which line of code initializes a student instance? 

A. Student student1; 

B. Student student1 = Student.new(); 

C. Student student1 = new Student(); 

D. Student student1 = Student(); 

Answer:


Q153. Given: 

class Cake { 

int model; 

String flavor; 

Cake() { 

model = 0; 

flavor = "Unknown"; 

public class Test { 

public static void main(String[] args) { 

Cake c = new Cake(); 

bake1(c); 

System.out.println(c.model + " " + c.flavor); 

bake2(c); 

System.out.println(c.model + " " + c.flavor); 

public static Cake bake1(Cake c) { 

c.flavor = "Strawberry"; 

c.model = 1200; 

return c; 

public static void bake2(Cake c) { 

c.flavor = "Chocolate"; 

c.model = 1230; 

return; 

What is the result? 

A. 0 unknown 0 unknown 

B. 1200 Strawberry 1200 Strawberry 

C. 1200 Strawberry 1230 Chocolate 

D. Compilation fails 

Answer:

Explanation: 1200 Strawberry 1230 Chocolate 


Q154. 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:


Q155. Given: 

public class MyClass { 

public static void main(String[] args) { 

String s = " Java Duke "; 

int len = s.trim().length(); 

System.out.print(len); 

What is the result? 

A. 8 

B. 9 

C. 11 

D. 10 

E. Compilation fails 

Answer:

Explanation: Java - String trim() Method 

This method returns a copy of the string, with leading and trailing whitespace omitted. 


Most recent 1z0-808 free exam questions:

Q156. Given the code fragment: 

Which statement is true? 

A. After line 8, three objects are eligible for garbage collection 

B. After line 8, two objects are eligible for garbage collection 

C. After line 8, one object is eligible for garbage collection 

D. After line 8, none of the objects are eligible for garbage collection 

Answer:


Q157. Given: 

What is the result? 

A. Option A 

B. Option B 

C. Option C 

D. Option D 

Answer:


Q158. Given: 

And the commands: 

Javac Test.java 

Java Test 12345 

What is the result? 

A. Number us : 12345 

B. A NullPointerException is thrown at runtime 

C. A NumberFormatException is thrown at runtime 

D. AnArrayIndexOutOfBoundException is thrown at runtime. 

Answer:


Q159. A method is declared to take three arguments. A program calls this method and passes only two arguments. What is the results? 

A. Compilation fails. 

B. The third argument is given the value null. 

C. The third argument is given the value void. 

D. The third argument is given the value zero. 

E. The third argument is given the appropriate falsy value for its declared type. F) An 

exception occurs when the method attempts to access the third argument. 

Answer:


Q160. Given: 

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 

Answer:

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