Act now and download your Oracle 1z0 808 pdf test today! Do not waste time for the worthless Oracle 1z0 808 dumps pdf tutorials. Download Renewal Oracle Java SE 8 Programmer I exam with real questions and answers and begin to learn Oracle java se 8 programmer i 1z0 808 pdf with a classic professional.


♥♥ 2017 NEW RECOMMEND ♥♥

Free VCE & PDF File for Oracle 1z0-808 Real Exam (Full Version!)

★ Pass on Your First TRY ★ 100% Money Back Guarantee ★ Realistic Practice Exam Questions

Free Instant Download NEW 1z0-808 Exam Dumps (PDF & VCE):
Available on: http://www.surepassexam.com/1z0-808-exam-dumps.html

Q61. Given the code fragment: 

List colors = new ArrayList(); 

colors.add("green"); 

colors.add("red"); 

colors.add("blue"); 

colors.add("yellow"); 

colors.remove(2); 

colors.add(3,"cyan"); 

System.out.print(colors); 

What is the result? 

A. [green, red, yellow, cyan] 

B. [green, blue, yellow, cyan] 

C. [green, red, cyan, yellow] 

D. Am IndexOutOfBoundsException is thrown at runtime 

Answer:

Explanation: First the list [green, red, blue, yellow] is build. 

The blue element is removed: 

[green, red, yellow] 

Finally the element cyan is added at then end of the list (index 3). 

[green, red, yellow, cyan] 


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


Q63. 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:


Q64. Which three statements are true about the structure of a Java class? 

A. A class can have only one private constructor. 

B. A method can have the same name as a field. 

C. A class can have overloaded static methods. 

D. A public class must have a main method. 

E. The methods are mandatory components of a class. 

F. The fields need not be initialized before use. 

Answer: A,B,C 

Explanation: A: Private constructors prevent a class from being explicitly instantiated by its 

callers. 

If the programmer does not provide a constructor for a class, then the system will always 

provide a default, public no-argument constructor. To disable this default constructor, 

simply add a private no-argument constructor to the class. This private constructor may be 

empty. 

B: The following works fine: 

int cake() { 

int cake=0; 

return (1); 

C: We can overload static method in Java. In terms of method overloading static method 

are just like normal methods and in order to overload static method you need to provide 

another static method with same name but different method signature. 

Incorrect: 

Not D: Only a public class in an application need to have a main method. 

Not E: 

Example: 

class A 

public string something; 

public int a; 

Q: What do you call classes without methods? Most of the time: An anti pattern. 

Why? Because it faciliates procedural programming with "Operator" classes and data 

structures. You separate data and behaviour which isn't exactly good OOP. 

Often times: A DTO (Data Transfer Object) 

Read only datastructures meant to exchange data, derived from a business/domain object. 

Sometimes: Just data structure. 

Well sometimes, you just gotta have those structures to hold data that is just plain and 

simple and has no operations on it. 

Not F: Fields need to be initialtized. If not the code will not compile. 

Example: 

Uncompilable source code - variable x might not have been initialized 


Q65. 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:


Q66. Given: 

What is the result? 

A. Option A 

B. Option B 

C. Option C 

D. Option D 

Answer:


Q67. Given the following code for the classes MyException and Test: 

What is the result? 

A. A 

B. B 

C. Either A or B 

D. A B 

E. A compile time error occurs at line n1 

Answer:


Q68. Given: 

public class SampleClass { 

public static void main(String[] args) { 

AnotherSampleClass asc = new AnotherSampleClass(); SampleClass sc = new 

SampleClass(); 

sc = asc; 

System.out.println("sc: " + sc.getClass()); 

System.out.println("asc: " + asc.getClass()); 

}} 

class AnotherSampleClass extends SampleClass { 

What is the result? 

A. sc: class Object asc: class AnotherSampleClass 

B. sc: class SampleClass asc: class AnotherSampleClass 

C. sc: class AnotherSampleClass asc: class SampleClass 

D. sc: class AnotherSampleClass asc: class AnotherSampleClass 

Answer:


Q69. What is the proper way to defined a method that take two int values and returns their sum as an int value? 

A. int sum(int first, int second) { first + second; } 

B. int sum(int first, second) { return first + second; } 

C. sum(int first, int second) { return first + second; } 

D. int sum(int first, int second) { return first + second; } 

E. void sum (int first, int second) { return first + second; } 

Answer:


Q70. Which three are advantages of the Java exception mechanism? 

A. Improves the program structure because the error handling code is separated from the normal program function 

B. Provides a set of standard exceptions that covers all the possible errors 

C. Improves the program structure because the programmer can choose where to handle exceptions 

D. Improves the program structure because exceptions must be handled in the method in which they occurred 

E. Allows the creation of new exceptions that are tailored to the particular program being created 

Answer: A,C,E