It is more faster and easier to pass the Oracle 1z0-808 exam by using Free Oracle Java SE 8 Programmer I questuins and answers. Immediate access to the Regenerate 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.

2017 Mar 1z0-808 actual test

Q51. Given the code fragment: 

What is the result? 

A. 28false29 true 

B. 285 < 429 true 

C. true true 

D. compilation fails 

Answer:


Q52. Which statement will empty the contents of a StringBuilder variable named sb? 

A. sb.deleteAll(); 

B. sb.delete(0, sb.size()); 

C. sb.delete(0, sb.length()); 

D. sb.removeAll(); 

Answer:


Q53. Given the code fragment: 

String[] cartoons = {"tom","jerry","micky","tom"}; 

int counter =0; 

if ("tom".equals(cartoons[0])) { 

counter++; 

} else if ("tom".equals(cartoons[1])) { 

counter++; 

} else if ("tom".equals(cartoons[2])) { 

counter++; 

} else if ("tom".equals(cartoons[3])) { 

counter++; 

System.out.print(counter); 

What is the result? 

A. 1 

B. 2 

C. 4 

D. 0 

Answer:

Explanation: Counter++ will be executed only once because of the else if constructs. 


Q54. Given: 

Which statement is true? 

A. Both p and s are accessible by obj. 

B. Only s is accessible by obj. 

C. Both r and s are accessible by obj. 

D. p, r, and s are accessible by obj. 

Answer:


Q55. You are developing a banking module. You have developed a class named ccMask that has a maskcc method. 

Given the code fragment:

You must ensure that the maskcc method returns a string that hides all digits of the credit card number except the four last digits (and the hyphens that separate each group of four digits). 

Which two code fragments should you use at line n1, independently, to achieve this requirement? 

A. Option A 

B. Option B 

C. Option C 

D. Option D 

Answer: B,C 


Renew 1z0-808 simulations:

Q56. Given the code fragment 

int var1 = -5; 

int var2 = var1--; 

int var3 = 0; 

if (var2 < 0) { 

var3 = var2++; 

} else { 

var3 = --var2; 

System.out.println(var3); 

What is the result? 

A. – 6 

B. – 4 

C. – 5 

D. 5 

E. 4 

F. Compilation fails 

Answer:


Q57. Given: 

And given the commands: 

javac Test.Java 

Java Test Hello 

What is the result? 

A. Success 

B. Failure 

C. Compilation fails. 

D. An exception is thrown at runtime 

Answer:


Q58. Given: 

class Mid { 

public int findMid(int n1, int n2) { 

return (n1 + n2) / 2; 

public class Calc extends Mid { 

public static void main(String[] args) { 

int n1 = 22, n2 = 2; 

// insert code here 

System.out.print(n3); 

Which two code fragments, when inserted at // insert code here, enable the code to compile and print 12? 

A. Calc c = new Calc(); int n3 = c.findMid(n1,n2); 

B. int n3 = super.findMid(n1,n3); 

C. Calc c = new Mid(); int n3 = c.findMid(n1, n2); 

D. Mid m1 = new Calc(); int n3 = m1.findMid(n1, n2); 

E. int n3 = Calc.findMid(n1, n2); 

Answer: A,D 

Explanation: 

Incorrect: 

Not B: circular definition of n3. 

Not C: Compilation error. line Calc c = new Mid(); 

required: Calc 

found: Mid 

Not E: Compilation error. line int n3 = Calc.findMid(n1, n2); 

non-static method findMid(int,int) cannot be referenced from a static context 


Q59. Which two items can legally be contained within a java class declaration? 

A. An import statement 

B. A field declaration 

C. A package declaration 

D. A method declaration 

Answer: B,D 

Reference: 

http://docs.oracle.com/javase/tutorial/java/javaOO/methods.html 


Q60. Given: 

public class Test { 

public static void main(String[] args) { 

int ax = 10, az = 30; 

int aw = 1, ay = 1; 

try { 

aw = ax % 2; 

ay = az / aw; 

} catch (ArithmeticException e1) { 

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

} catch (Exception e2) { 

aw = 1; 

System.out.println("Divisor Changed"); 

ay = az /aw; // Line 14 

System.out.println("Succesful Division " + ay); 

What is the result? 

A. Invalid Divisor 

Divisor Changed 

Successful Division 30 

B. Invalid Divisor 

Successful Division 30 

C. Invalid Divisor 

Exception in thread "main" java.lang.ArithmeticException: / by zero 

at test.Teagle.main(Teagle.java:14) 

D. Invalid Divisor 

Exception in thread "main" java.lang.ArithmeticException: / by zero 

at test.Teagle.main(Teagle.java:14) 

Successful Division 1 

Answer: