Oracle Oracle 1z0-808 exam is meant to measure your skills and skills of problem-solving. You are able to achieve 100% good results by utilizing our Oracle 1z0-808 practice question as well as answers. Our compilers from the 1z0-808 exam barindumps are dedicating in order to making improvements from the quality as well as usability. All the staff members make great contribution on the Oracle Oracle training program ever because we began.

2017 Mar 1z0-808 sample question

Q31. Given: 

Class A { } 

Class B { } 

Interface X { } 

Interface Y { } 

Which two definitions of class C are valid? 

A. Class C extends A implements X { } 

B. Class C implements Y extends B { } 

C. Class C extends A, B { } 

D. Class C implements X, Y extends B { } 

E. Class C extends B implements X, Y { } 

Answer: A,E 

Explanation: extends is for extending a class. 

implements is for implementing an interface. Java allows for a class to implement many interfaces. 


Q32. View the exhibit. 

Given the code fragment: 

Which change enables the code to print the following? 

James age: 20 

Williams age: 32 

A. Replacing line 5 with public static void main (String [] args) throws MissingInfoException, AgeOutofRangeException { 

B. Replacing line 5 with public static void main (String [] args) throws.Exception { 

C. Enclosing line 6 and line 7 within a try block and adding: catch(Exception e1) { //code goes here} catch (missingInfoException e2) { //code goes here} catch (AgeOutofRangeException e3) {//code goes here} 

D. Enclosing line 6 and line 7 within a try block and adding: catch (missingInfoException e2) { //code goes here} catch (AgeOutofRangeException e3) {//code goes here} 

Answer:


Q33. Given: 

public class String1 { 

public static void main(String[] args) { 

String s = "123"; 

if (s.length() >2) 

s.concat("456"); 

for(int x = 0; x <3; x++) 

s += "x"; 

System.out.println(s); 

What is the result? 

A. 123 

B. 123xxx 

C. 123456 

D. 123456xxx 

E. Compilation fails 

Answer:

Explanation: 123xxx 

The if clause is not applied. 

Note: Syntax of if-statement: 

if ( Statement ) { 


Q34. Given the following class: 

And given the following main method, located in another class: 

Which three lines, when inserted independently at line n1, cause the program to print a o balance? 

A. this.amount = 0; 

B. amount = 0; 

C. acct (0) ; 

D. acct.amount = 0; 

E. acct. getAmount () = 0; 

F. acct.changeAmount(0); 

G. acct.changeAmount(-acct.amount); 

H. acct.changeAmount(-acct.getAmount()); 

Answer: D,G,H 


Q35. Given the code fragments: 

What is the result? 

A. Super Sub Sub 

B. Contract Contract Super 

C. Compilation fails at line n1 

D. Compilation fails at line n2 

Answer:


Most recent 1z0-808 free download:

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


Q37. Given: 

What is the result? 

A. C B A 

B. C 

C. A B C 

D. Compilation fails at line n1 and line n2 

Answer:


Q38. Given: 

public class ColorTest { 

public static void main(String[] args) { 

String[] colors = {"red", "blue","green","yellow","maroon","cyan"}; 

int count = 0; 

for (String c : colors) { 

if (count >= 4) { 

break; 

else { 

continue; 

if (c.length() >= 4) { 

colors[count] = c.substring(0,3); 

count++; 

System.out.println(colors[count]); 

What is the result? 

A. Yellow 

B. Maroon 

C. Compilation fails 

D. A StringIndexOutOfBoundsException is thrown at runtime. 

Answer:

Explanation: The line, if (c.length() >= 4) {, is never reached. This causes a compilation error. 

Note: The continue statement skips the current iteration of a for, while , or do-while loop. An unlabeled.break.statement terminates the innermost.switch,.for,.while, or.do-while.statement, but a labeled.break.terminates an outer statement. 


Q39. Given the fragment: 

What is the result? 

A. 13480.0 

B. 13480.02 

C. Compilation fails 

D. An exception is thrown at runtime 

Answer:


Q40. Given: 

public class App { // Insert code here System.out.print("Welcome to the world of Java"); } } 

Which two code fragments, when inserted independently at line // Insert code here, enable the program to execute and print the welcome message on the screen? 

A. static public void main (String [] args) { 

B. static void main (String [] args) { 

C. public static void Main (String [] args) { 

D. public static void main (String [] args) { 

E. public void main (String [] args) { 

Answer: A,D 

Explanation: 

Incorrect: 

Not B: No main class found. 

Not C: Main method not found 

not E: Main method is not static.