Jul 2016 updated: Actualtests Oracle 1z0-808 free exam questions 11-20

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

2016 Jul 1z0-808 test engine

Q11. Given: 

class Cake { 

int model; 

String flavor; 

Cake() { 

model = 0; 

flavor = "Unknown"; 

public class Test { 

public static void main(String[] args) { 

Cake c = new Cake(); 

bake1(c); 

System.out.println(c.model + " " + c.flavor); 

bake2(c); 

System.out.println(c.model + " " + c.flavor); 

public static Cake bake1(Cake c) { 

c.flavor = "Strawberry"; 

c.model = 1200; 

return c; 

public static void bake2(Cake c) { 

c.flavor = "Chocolate"; 

c.model = 1230; 

return; 

What is the result? 

A. 0 unknown 0 unknown 

B. 1200 Strawberry 1200 Strawberry 

C. 1200 Strawberry 1230 Chocolate 

D. Compilation fails 

Answer: C 

Explanation: 1200 Strawberry 1230 Chocolate 


Q12. 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: A 

Explanation: 

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


Q13. The protected modifier on a Field declaration within a public class means that the field ______________. 

A. Cannot be modified 

B. Can be read but not written from outside the class 

C. Can be read and written from this class and its subclasses only within the same package 

D. Can be read and written from this class and its subclasses defined in any package 

Answer: D 

Reference: 

http://beginnersbook.com/2013/05/java-access-modifiers/ 


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


Q15. Given the code fragment: 


What is the result? 

A. Values are : [EE, ME] 

B. Values are : [EE, EE, ME] 

C. Values are : [EE, ME, EE] 

D. Values are : [SE, EE, ME, EE] 

E. Values are : [EE, ME, SE, EE] 

Answer: E 


2passeasy.com

Leading 1z0-808 rapidshare:

Q16. Given: 

public class FieldInit { 

char c; 

boolean b; 

float f; 

void printAll() { 

System.out.println("c = " + c); 

System.out.println("c = " + b); 

System.out.println("c = " + f); 

public static void main(String[] args) { 

FieldInit f = new FieldInit(); 

f.printAll(); 

What is the result? 

A. c = null 

b = false 

f = 0.0F 

B. c = 0 

b = false 

f = 0.0f 

C. c = null 

b = true 

f = 0.0 

D. c = 

b = false 

f = 0.0 

Answer: D 


Q17. Given: 

class Sports { 

int num_players; 

String name, ground_condition; 

Sports(int np, String sname, String sground){ 

num_players = np; 

name = sname; 

ground_condition = sground; 

class Cricket extends Sports { 

int num_umpires; 

int num_substitutes; 

Which code fragment can be inserted at line //insert code here to enable the code to compile? 

A. Cricket() { 

super(11, "Cricket", "Condidtion OK"); 

num_umpires =3; 

num_substitutes=2; 

B. Cricket() { 

super.ground_condition = "Condition OK"; 

super.name="Cricket"; 

super.num_players = 11; 

num_umpires =3; 

num_substitutes=2; 

C. Cricket() { 

this(3,2); 

super(11, "Cricket", "Condidtion OK"); 

Cricket(int nu, ns) { 

this.num_umpires =nu; 

this.num_substitutes=ns; 

D. Cricket() { 

this.num_umpires =3; 

this.num_substitutes=2; 

super(11, "Cricket", "Condidtion OK"); 

Answer: A 

Explanation: 

Incorrect: 

not C, not D: call to super must be the first statement in constructor. 


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


Q19. Given: 


What is the result? 

A. 400 200 

B. 200 200 

C. 400 400 

D. Compilation fails. 

Answer: A 


Q20. Given: 

public class Test { 

static boolean bVar; 

public static void main(String[] args) { 

boolean bVar1 = true; 

int count =8; 

do { 

System.out.println("Hello Java! " +count); 

if (count >= 7) { 

bVar1 = false; 

} while (bVar != bVar1 && count > 4); 

count -= 2; 

What is the result? 

A. Hello Java! 8 Hello Java! 6 Hello Java! 4 

B. Hello Java! 8 Hello Java! 6 

C. Hello Java! 8 

D. Compilation fails 

Answer: C 

Explanation: Hello Java! 8 



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