It is impossible to pass Oracle 1z0-808 exam without any help in the short term. Come to Actualtests soon and find the most advanced, correct and guaranteed Oracle 1z0-808 practice questions. You will get a surprising result by our Refresh Java SE 8 Programmer I practice guides.

2021 Mar 1z0-808 free exam questions

Q61. Given: 

public class Test { 

public static void main(String[] args) { 

int arr[] = new int[4]; 

arr[0] = 1; 

arr[1] = 2; 

arr[2] = 4; 

arr[3] = 5; 

int sum = 0; 

try { 

for (int pos = 0; pos <= 4; pos++) { 

sum = sum + arr[pos]; 

} catch (Exception e) { 

System.out.println("Invalid index"); 

System.out.println(sum); 

What is the result? 

A. 12 

B. Invalid Index 

C. Invalid Index 

D. Compilation fails 

Answer:

Explanation: The loop ( for (int pos = 0; pos <= 4; pos++) { ), it should be pos <= 3, causes an exception, which is caught. Then the correct sum is printed. 


Q62. Given: 

What is the result? 

A. true:true 

B. true:false 

C. false:true 

D. false:false 

Answer:


Q63. Given: 

Which constructor initializes the variable x3? 

A. Only the default constructor of class X 

B. Only the no-argument constructor of class Y 

C. Only the no-argument constructor of class Z 

D. Only the default constructor of object class 

Answer:


Q64. Given the code fragment: 

A. Super Sub Sub 

B. Contract Contract Super 

C. Compilation fails at line n1 

D. Compilation fails at line n2 

Answer:


Q65. Given the code fragment: 

And given the requirements: 

. If the value of the qty variable is greater than or equal to 90, discount = 0.5 

. If the value of the qty variable is between 80 and 90, discount = 0.2 

Which two code fragments can be independently placed at line n1 to meet the requirements? 

A. Option A 

B. Option B 

C. Option C 

D. Option D 

E. Option E 

Answer: A,C 


Abreast of the times 1z0-808 exam prep:

Q66. Given: 

And given the code fragment: 

What is the result? 

A. 4W 100 Auto 4W 150 Manual 

B. Null 0 Auto 4W 150 Manual 

C. Compilation fails only at line n1 

D. Compilation fails only at line n2 

E. Compilation fails at both line n1 and line n2 

Answer:

Explanation: 

On line n1 implicit call to parameterized constructor is missing and n2 this() must be the first line. 


Q67. Given the code fragment: 

Which code fragment, when inserted at // insert code here, enables the code to compile and and print a b c? 

A. List update (String[] strs) 

B. Static ArrayListupdate(String [] strs) 

C. Static List update (String [] strs) 

D. Static void update (String[] strs) 

E. ArrayList static update(String [] strs) 

Answer:


Q68. Given the code fragment: 

public class Test { 

public static void main(String[] args) { 

boolean isChecked = false; 

int arry[] = {1,3,5,7,8,9}; 

int index = arry.length; 

while ( <code1> ) { 

if (arry[index-1] % 2 ==0) { 

isChecked = true; 

<code2> 

System.out.print(arry(index]+", "+isChecked)); 

Which set of changes enable the code to print 1, true? 

A. Replacing <code1> with index > 0 and replacing <code2> with index--; 

B. Replacing <code1> with index > 0 and replacing <code2> with --index; 

C. Replacing <code1> with index > 5 and replacing <code2> with --index ; 

D. Replacing <code1> with index and replacing <code2> with --index ; 

Answer:

Explanation: 

Note: Code in B (code2 is --index;). also works fine. 


Q69. Given the following code: 

What are the values of each element in intArr after this code has executed? 

A. 15, 60, 45, 90, 75 

B. 15, 90, 45, 90, 75 

C. 15, 30, 75, 60, 90 

D. 15, 30, 90, 60, 90 

E. 15, 4, 45, 60, 90 

Answer:


Q70. 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 

Answer:

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