1z0-808 tutorials(61 to 70) for candidates: Jul 2016 Edition

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

2016 Jul 1z0-808 real exam

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


Q62. Given: 

Given: 

public class SuperTest { 

public static void main(String[] args) { 

statement1 

statement2 

statement3 

class Shape { 

public Shape() { 

System.out.println("Shape: constructor"); 

public void foo() { 

System.out.println("Shape: foo"); 

class Square extends Shape { 

public Square() { 

super(); 

public Square(String label) { 

System.out.println("Square: constructor"); 

public void foo() { 

super.foo(); 

public void foo(String label) { 

System.out.println("Square: foo"); 

What should statement1, statement2, and statement3, be respectively, in order to produce the result? 

Shape: constructor 

Square: foo 

Shape: foo 

A. Square square = new Square ("bar"); 

square.foo ("bar"); 

square.foo(); 

B. Square square = new Square ("bar"); 

square.foo ("bar"); 

square.foo ("bar"); 

C. Square square = new Square (); 

square.foo (); 

square.foo(bar); 

D. Square square = new Square (); 

square.foo (); 

square.foo("bar"); 

E. Square square = new Square (); 

square.foo (); 

square.foo (); 

F. Square square = new Square(); 

square.foo("bar"); 

square.foo(); 

Answer: F 


Q63. Given the code in a file Traveler.java: 


And the commands: 

Javac Traveler.java 

Java Traveler Java Duke What is the result? 

A. Happy Journey! Duke 

B. Happy Journey! Java 

C. An exception is thrown at runtime 

D. The program fails to execute due to a runtime error 

Answer: D 


Q64. Given: 


What is the result? 

A. true true 

B. true false 

C. false true 

D. false false 

E. Compilation fails 

Answer: E 


Q65. Given the code fragment: 


Which two modifications should you make so that the code compiles successfully? 


A. Option A 

B. Option B 

C. Option C 

D. Option D 

E. Option E 

Answer: A,C 

Explanation: 

Add throws clause in both printFileContent and main. 


2passeasy.com

Refresh 1z0-808 download:

Q66. Given the code fragment: 


Which two modifications, when made independently, enable the code to print joe:true: 100.0? 


A. Option A 

B. Option B 

C. Option C 

D. Option D 

E. Option E 

Answer: A,C 


Q67. Given: 

public class TestOperator { 

public static void main(String[] args) { 

int result = 30 -12 / (2*5)+1; 

System.out.print("Result = " + result); 

What is the result? 

A. Result = 2 

B. Result = 3 

C. Result = 28 

D. Result = 29 

E. Result = 30 

Answer: E 


Q68. Which two are benefits of polymorphism? 

A. Faster code at runtime 

B. More efficient code at runtime 

C. More dynamic code at runtime 

D. More flexible and reusable code 

E. Code that is protected from extension by other classes 

Answer: C,D 


Q69. Given: 

public class ComputeSum { 

public int x; 

public int y; 

public int sum; 

public ComputeSum (int nx, int ny) { 

x = nx; y =ny; 

updateSum(); 

public void setX(int nx) { x = nx; updateSum();} 

public void setY(int ny) { x = ny; updateSum();} 

void updateSum() { sum = x + y;} 

This class needs to protect an invariant on the sum field. 

Which three members must have the private access modifier to ensure that this invariant is maintained? 

A. The x field 

B. The y field 

C. The sum field 

D. The ComputerSum ( ) constructor 

E. The setX ( ) method 

F. The setY ( ) method 

Answer: C,E,F 

Explanation: The sum field and the two methods (setX and SetY) that updates the sum field. 


Q70. Given: 

package p1; 

public class Test { 

static double dvalue; 

static Test ref; 

public static void main(String[] args) { 

System.out.println(ref); 

System.out.println(dvalue); 

What is the result? 

A. p1.Test.class 

0.0 

B. <the summary address refrenced by ref> 0.000000 

C. Null 

0.0 

D. Compilation fails 

E. A NullPointerException is thrown at runtime 

Answer: C 



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