1z0-808 samples(151 to 160) for examinee: Jul 2016 Edition

1z0-808 Royal Pack Testengine pdf

100% Actual & Verified — 100% PASS

Unlimited access to the world's largest Dumps library!

https://www.2passeasy.com/dumps/1z0-808/

100% Guarantee of 1z0-808 brain dumps materials and forum for Oracle certification for client, Real Success Guaranteed with Updated 1z0-808 pdf dumps vce Materials. 100% PASS Java SE 8 Programmer I exam Today!

2016 Jul 1z0-808 free practice questions

Q151. Given the code fragment: 


Which code fragment prints red: blue: small: medium? 


A. Option A 

B. Option B 

C. Option C 

D. Option D 

Answer: D 


Q152. 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: B 


Q153. Given the code fragment: 


What is the result? 

A. Found Red 

Found Default 

B. Found Teal 

C. Found Red 

Found Blue 

Found Teal 

D. Found Red 

Found Blue 

Found Teal 

Found Default 

E. Found Default 

Answer: B 


Q154. Given: 


The class is poorly encapsulated. You need to change the circle class to compute and return the area instead. 

Which two modifications are necessary to ensure that the class is being properly encapsulated? 

A. Remove the area field. 

B. Change the getArea( ) method as follows: 

public double getArea ( ) { return Match.PI * radius * radius; } 

C. Add the following method: 

public double getArea ( ) {area = Match.PI * radius * radius; } 

D. Change the cacess modifier of the SerRadius ( ) method to be protected. 

Answer: B,D 


Q155. Given: 

public class TestLoop { 

public static void main(String[] args) { 

int array[] = {0, 1, 2, 3, 4}; 

int key = 3; 

for (int pos = 0; pos < array.length; ++pos) { 

if (array[pos] == key) { 

break; 

System.out.print("Found " + key + "at " + pos); 

What is the result? 

A. Found 3 at 2 

B. Found 3 at 3 

C. Compilation fails 

D. An exception is thrown at runtime 

Answer: C 

Explanation: The following line does not compile: System.out.print("Found " + key + "at " + pos); 

The variable pos is undefined at this line, as its scope is only valid in the for loop. Any variables created inside of a loop are LOCAL TO THE LOOP. 


1z0-808  brain dumps

Improve 1z0-808 download:

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


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


Q158. Given: 

public class Test { 

public static void main(String[] args) { 

int day = 1; 

switch (day) { 

case "7": System.out.print("Uranus"); 

case "6": System.out.print("Saturn"); 

case "1": System.out.print("Mercury"); 

case "2": System.out.print("Venus"); 

case "3": System.out.print("Earth"); 

case "4": System.out.print("Mars"); 

case "5": System.out.print("Jupiter"); 

Which two modifications, made independently, enable the code to compile and run? 

A. Adding a break statement after each print statement 

B. Adding a default section within the switch code-block 

C. Changing the string literals in each case label to integer 

D. Changing the type of the variable day to String 

E. Arranging the case labels in ascending order 

Answer: A,C 

Explanation: The following will work fine: 

public class Test { 

public static void main(String[] args) { 

int day = 1; 

switch (day) { 

case 7: System.out.print("Uranus"); break; 

case 6: System.out.print("Saturn"); break; 

case 1: System.out.print("Mercury"); break; 

case 2: System.out.print("Venus"); break; 

case 3: System.out.print("Earth"); break; 

case 4: System.out.print("Mars"); break; 

case 5: System.out.print("Jupiter"); break; 


Q159. 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: D 


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



see more Java SE 8 Programmer I