Tips to Pass 1Z0-809 Exam (41 to 50)

Youre going to get the actual in depth reason whenever you face difficulties during your [productsort] research. Pass4sure give you the actual [productsort] Java SE 8 Programmer II key points legibly within the [productsort] dumps. These types of tremendously conserving the costs to get acquainted with the actual Oracle classes.

2016 Aug 1Z0-809 braindumps

Q41. Which two are Java Exception classes? 

A. SercurityException 

B. DuplicatePathException 

C. IllegalArgumentException 

D. TooManyArgumentsException 

Answer: A,C 


Q42. Given the definition of the Vehicle class: 

class Vehicle { 

String name; 

void setName (String name) { 

this.name = name; 

String getName() { 

return name; 

Which action encapsulates the Vehicle class? 

A. Make the Vehicle class public. 

B. Make the name variable public. 

C. Make the setName method public. 

D. Make the name variable private. 

E. Make the setName method private. 

F. Make the getName method private. 

Answer: B 


Q43. Given: 

public class Canvas implements Drawable { 

public void draw () { } 

public abstract class Board extends Canvas { } 

public class Paper extends Canvas { 

protected void draw (int color) { } 

public class Frame extends Canvas implements Drawable { 

public void resize () { } 

public interface Drawable { 

public abstract void draw (); 

Which statement is true? 

A. Board does not compile. 

B. Paper does not compile. 

C. Frame does not compile. 

D. Drawable does not compile. 

E. All classes compile successfully. 

Answer: B 


Q44. Given: 

public class product { int id; int price; 

public Product (int id, int price) { 

this.id = id; 

this.price = price; 

public String toString() { return id + “:” + price; } 

and the code fragment: 

List<Product> products = Arrays.asList(new Product(1, 10), 

new Product (2, 30), 

new Product (2, 30)); 

Product p = products.stream().reduce(new Product (4, 0), (p1, p2) -> { 

p1.price+=p2.price; 

return new Product (p1.id, p1.price);}); 

products.add(p); 

products.stream().parallel() 

.reduce((p1, p2) - > p1.price > p2.price ? p1 : p2) 

.ifPresent(System.out: :println); 

What is the result? 

A. 2 : 30 

B. 4 : 0 

C. 4 : 60 

D. 4 : 60 

2 : 30 

3 : 20 

1 : 10 

E. 

The program prints nothing. 

Answer: D 


Q45. Given the code fragment: 

UnaryOperator<Integer> uo1 = s -> s*2;line n1 

List<Double> loanValues = Arrays.asList(1000.0, 2000.0); 

loanValues.stream() 

.filter(lv -> lv >= 1500) 

.map(lv -> uo1.apply(lv)) 

.forEach(s -> System.out.print(s + “ “)); 

What is the result? 

A. 4000.0 

B. 4000 

C. A compilation error occurs at line n1. 

D. A compilation error occurs at line n2. 

Answer: B 


1Z0-809 exam guide

Leading 1Z0-809 exam answers:

Q46. Given the class definitions: 

And the code fragment of the main() method, 

What is the result? 

A. Java Java Java 

B. Java Jeve va 

C. Java Jeve ve 

D. Compilation fails 

Answer: D 


Q47. Given the code fragment: 

List<String> str = Arrays.asList (“my”, “pen”, “is”, “your’, “pen”); Predicate<String> test = s -> { 

int i = 0; 

boolean result = s.contains (“pen”); 

System.out.print(i++) + “:”); 

return result; 

}; 

str.stream() 

.filter(test) 

.findFirst() 

.ifPresent(System.out ::print); 

What is the result? 

A. 0 : 0 : pen 

B. 0 : 1 : pen 

C. 0 : 0 : 0 : 0 : 0 : pen 

D. 0 : 1 : 2 : 3 : 4 : 

E. A compilation error occurs. 

Answer: E 


Q48. 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/ 


Q49. Given the code fragment: 

BiFunction<Integer, Double, Integer> val = (t1, t2) -> t1 + t2;//line n1 

System.out.println(val.apply(10, 10.5)); 

What is the result? 

A. 20 

B. 20.5 

C. A compilation error occurs at line n1. 

D. A compilation error occurs at line n2. 

Answer: C 


Q50. Given the code fragment: 

public static void main (String[] args) throws IOException { 

BufferedReader brCopy = null; 

try (BufferedReader br = new BufferedReader (new FileReader(“employee.txt”))) { // 

line n1 

br.lines().forEach(c -> System.out.println(c)); 

brCopy = br;//line n2 

brCopy.ready(); //line n3; 

Assume that the ready method of the BufferedReader, when called on a closed BufferedReader, throws an exception, and employee.txt is accessible and contains valid text. 

What is the result? 

A. A compilation error occurs at line n3. 

B. A compilation error occurs at line n1. 

C. A compilation error occurs at line n2. 

D. The code prints the content of the employee.txt file and throws an exception at line n3. 

Answer: B 



see more 1Z0-809 dumps