Jul 2021 updated: Pass4sure Oracle 1z0-808 exam question 121-130

It is more faster and easier to pass the Oracle 1z0-808 exam by using Certified Oracle Java SE 8 Programmer I questuins and answers. Immediate access to the Rebirth 1z0-808 Exam and find the same core area 1z0-808 questions with professionally verified answers, then PASS your exam with a high score now.

2021 Jul 1z0-808 pdf exam

Q121. 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: C 

Q122. Which of the following will print current time? 

A. System.out.print(new LocalTime()-now0); 

B. System.out.print(new LocalTime()); 

C. System.ouLprint(LocalTime.now()); 

D. System.ouLprint(LocalTime.today()); 

E. None of the above. 

Answer: C 


The LocalTime is an interface, so we can't use new keyword with them. So options A and C are incorrect. To get current time we can call now method on LocalTime interface. So option C is correct. Option D is incorrect as there is no method called today as in LocalTime interface 


Q123. Given: 

public class Test { 

public static void main(String[] args) { 

try { 

String[] arr =new String[4]; 

arr[1] = "Unix"; 

arr[2] = "Linux"; 

arr[3] = "Solarios"; 

for (String var : arr) { 

System.out.print(var + " "); 

} catch(Exception e) { 

System.out.print (e.getClass()); 

What is the result? 

A. Unix Linux Solaris 

B. Null Unix Linux Solaris 

C. Class java.lang.Exception 

D. Class java.lang.NullPointerException 

Answer: B 

Explanation: null Unix Linux Solarios 

The first element, arr[0], has not been defined. 

Q124. Given: 

Which two code fragments are valid? 

A. Option A 

B. Option B 

C. Option C 

D. Option D 

E. Option E 

Answer: B,C 

Explanation: When an abstract class is subclassed, the subclass usually provides implementations for all of the abstract methods in its parent class (C). 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. 

Q125. Given the following code for a Planet object: 

What is the output? 

A. Option A 

B. Option B 

C. Option C 

D. Option D 

E. Option E 

Answer: C 

1z0-808  exam engine

Most up-to-date 1z0-808 vce:

Q126. Given the code fragment: 

Which two modifications, made independently, enable the code to compile? 

A. Make the method at line n1 public. 

B. Make the method at line n2 public. 

C. Make the method at line n3 public. 

D. Make the method at line n3 protected. 

E. Make the method at line n4 public. 

Answer: C,D 

Q127. Given: 

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 

Answer: B 


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 


Q128. Given: 

Which code fragment, when inserted at line 9, enables the code to print true? 

A. String str2 = str1; 

B. String str2 = new string (str1); 

C. String str2 = sb1.toString(); 

D. String str2 = “Duke”; 

Answer: B 

Q129. Given the code fragment: 

What is the result? 

A. Jesse 25 Walter 52 

B. Compilation fails only at line n1 

C. Compilation fails only at line n2 

D. Compilation fails at both line n1 and line n2 

Answer: D 

Q130. Given: 

What is the result? 

A. A B C D 

B. A C D 

C. A B C 

D. A B D 

E. A B D C 

Answer: C 

see more http://www.2passeasy.com/exam/1z0-808/