Your success in Oracle 1z0 808 pdf is our sole target and we develop all our 1z0 808 pdf braindumps in a way that facilitates the attainment of this target. Not only is our 1z0 808 book study material the best you can find, it is also the most detailed and the most updated. exam 1z0 808 Practice Exams for Oracle Java 1z0 808 dumps are written to the highest standards of technical accuracy.

Q131. Given the code fragment: 

public class Test { 

static String[][] arr =new String[3][]; 

private static void doPrint() { 

//insert code here 

public static void main(String[] args) { 

String[] class1 = {"A","B","C"}; 

String[] class2 = {"L","M","N","O"}; 

String[] class3 = {"I","J"}; 

arr[0] = class1; 

arr[1] = class2; 

arr[2] = class3; 

Test.doPrint(); 

Which code fragment, when inserted at line //insert code here, enables the code to print 

COJ? 

A. int i = 0; 

for (String[] sub: arr) { 

int j = sub.length -1; 

for (String str: sub) { 

System.out.println(str[j]); 

i++; 

B. private static void doPrint() { 

for (int i = 0;i < arr.length;i++) { 

int j = arr[i].length-1; 

System.out.print(arr[i][j]); 

C. int i = 0; 

for (String[] sub: arr[][]) { 

int j = sub.length; 

System.out.print(arr[i][j]); 

i++; 

D. for (int i = 0;i < arr.length-1;i++) { 

int j = arr[i].length-1; 

System.out.print(arr[i][j]); 

i++; 

Answer:

Explanation: 

Incorrect: 

not A: The following line causes a compile error: 

System.out.println(str[j]); 

Not C: Compile erro line: 

for (String[] sub: arr[][]) 

not D: Output: C 


Q132. Given: 

And the commands: 

Javac Jump.java 

Java Jump crazy elephant is always 

What is the result? 

A. Lazy lion is jumping 

B. Lion is always jumping 

C. Crazy elephant is jumping 

D. Elephant is always jumping 

E. Compilation fails 

Answer:


Q133. Given the code fragment: 

public static void main(String[] args) { 

int iArray[] = {65, 68, 69}; 

iArray[2] = iArray[0]; 

iArray[0] = iArray[1]; 

iArray[1] = iArray[2]; 

for (int element : iArray) { 

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

A. 68, 65, 69 

B. 68, 65, 65 

C. 65, 68, 65 

D. 65, 68, 69 

E. Compilation fails 

Answer:


Q134. Which three are advantages of the Java exception mechanism? 

A. Improves the program structure because the error handling code is separated from the normal program function 

B. Provides a set of standard exceptions that covers all the possible errors 

C. Improves the program structure because the programmer can choose where to handle exceptions 

D. Improves the program structure because exceptions must be handled in the method in which they occurred 

E. Allows the creation of new exceptions that are tailored to the particular program being created 

Answer: A,C,E 


Q135. Which two are valid array declaration? 

A. Object array[]; 

B. Boolean array[3]; 

C. int[] array; 

D. Float[2] array; 

Answer: A,C 


Q136. Given the following code for the classes MyException and Test: 

What is the result? 

A. A 

B. B 

C. Either A or B 

D. A B 

E. A compile time error occurs at line n1 

Answer:


Q137. Given: 

What is the result? 

A. int main 1 

B. Object main 1 

C. String main 1 

D. Compilation fails 

E. An exception is thrown at runtime 

Answer:


Q138. Given: 

A. X XX 

B. X Y X 

C. Y Y X 

D. Y YY 

Answer:


Q139. Given the code fragment: 

Which code fragment prints blue, cyan, ? 

A. Option A 

B. Option B 

C. Option C 

D. Option D 

Answer:


Q140. Given: 

package p1; 

public interface DoInterface { 

void method1(int n1); // line n1 

package p3; 

import p1.DoInterface; 

public class DoClass implements DoInterface { 

public DoClass(int p1) { } 

public void method1(int p1) { } // line n2 

private void method2(int p1) { } // line n3 

public class Test { 

public static void main(String[] args) { 

DoInterface doi= new DoClass(100); // line n4 

doi.method1(100); 

doi.method2(100); 

Which change will enable the code to compile? 

A. Adding the public modifier to the declaration of method1 at line n1 

B. Removing the public modifier from the definition of method1 at line n2 

C. Changing the private modifier on the declaration of method 2 public at line n3 

D. Changing the line n4 DoClass doi = new DoClass ( ); 

Answer:

Explanation: Private members (both fields and methods) are only accessible inside the class they are declared or inside inner classes. private keyword is one of four access modifier provided by Java and its a most restrictive among all four e.g. public, default(package), protected and private. 

Read more: http://javarevisited.blogspot.com/2012/03/private-in-java-why-should-you-always.html#ixzz3Sh3mOc4D