1Z0-809 Guide

Jan 2021 updated: Actualtests Oracle 1Z0-809 practice exam 31-40

It is more faster and easier to pass the Oracle 1Z0-809 exam by using Real Oracle Java SE 8 Programmer II questuins and answers. Immediate access to the Improve 1Z0-809 Exam and find the same core area 1Z0-809 questions with professionally verified answers, then PASS your exam with a high score now.

Q31. Given: 

IntStream stream = IntStream.of (1,2,3); IntFunction<Integer> inFu= x -> y -> x*y;//line n1 IntStream newStream = stream.map(inFu.apply(10));//line n2 

newStream.forEach(System.output::print); 

Which modification enables the code fragment to compile? 

A. Replace line n1 with: 

IntFunction<UnaryOperator> inFu = x -> y -> x*y; 

B. Replace line n1 with: 

IntFunction<IntUnaryOperator> inFu = x -> y -> x*y; 

C. Replace line n1 with: 

BiFunction<IntUnaryOperator> inFu = x -> y -> x*y; 

D. Replace line n2 with: 

IntStream newStream = stream.map(inFu.applyAsInt (10)); 

Answer:


Q32. Given: 

What is the result? 

A. The sum is 2 

B. The sum is 14 

C. The sum is 15 

D. The loop executes infinite times 

E. Compilation fails 

Answer:


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

Reference: 

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


Q34. Given: What is the result? 

A. Initialized Started 

B. Initialized Started Initialized 

C. Compilation fails 

D. An exception is thrown at runtime 

Answer:


Q35. Given the code fragment: 

Path p1 = Paths.get(“/Pics/MyPic.jpeg”); System.out.println (p1.getNameCount() + “:” + p1.getName(1) + “:” + p1.getFileName()); 

Assume that the Pics directory does NOT exist. What is the result? 

A. An exception is thrown at run time. 

B. 2:MyPic.jpeg: MyPic.jpeg 

C. 1:Pics:/Pics/ MyPic.jpeg 

D. 2:Pics: MyPic.jpeg 

Answer:


Q36. Given: What is the result? 

A. box 

B. nbo 

C. bo 

D. nb 

E. An exception is thrown at runtime 

Answer:


Q37. Given: 

interface Doable { 

public void doSomething (String s); 

Which two class definitions compile? 

A. public abstract class Task implements Doable { 

public void doSomethingElse(String s) { } 

B. public abstract class Work implements Doable { 

public abstract void doSomething(String s) { } 

public void doYourThing(Boolean b) { } 

C. public class Job implements Doable { 

public void doSomething(Integer i) { } 

D. public class Action implements Doable { 

public void doSomething(Integer i) { } 

public String doThis(Integer j) { } 

E. public class Do implements Doable { 

public void doSomething(Integer i) { } 

public void doSomething(String s) { } 

public void doThat (String s) { } 

Answer: C,D 


Q38. Given: What is the result? 

A. 100 210 

B. Compilation fails due to an error in line n1 

C. Compilation fails due to an error at line n2 

D. Compilation fails due to an error at line n3 

Answer:


Q39. Given: 

public enum USCurrency { 

PENNY (1), 

NICKLE(5), 

DIME (10), 

QUARTER(25); 

private int value; 

public USCurrency(int value) { 

this.value = value; 

public int getValue() {return value;} 

public class Coin { 

public static void main (String[] args) { 

USCurrency usCoin =new USCurrency.DIME; 

System.out.println(usCoin.getValue()): 

Which two modifications enable the given code to compile? 

A. Nest the USCurrency enumeration declaration within the Coin class. 

B. Make the USCurrency enumeration constructor private. 

C. Remove the new keyword from the instantion of usCoin. 

D. Make the getter method of value as a static method. 

E. Add the final keyword in the declaration of value. 

Answer: A,E 


Q40. Given the code fragment: 

public class Foo { 

public static void main (String [ ] args) { 

Map<Integer, String> unsortMap = new HashMap< > ( ); 

unsortMap.put (10, “z”); 

unsortMap.put (5, “b”); 

unsortMap.put (1, “d”); 

unsortMap.put (7, “e”); 

unsortMap.put (50, “j”); 

Map<Integer, String> treeMap = new TreeMap <Integer, String> (new 

Comparator<Integer> ( ) { 

@Override public int compare (Integer o1, Integer o2) {return o2.compareTo 

(o1); } } ); 

treeMap.putAll (unsortMap); 

for (Map.Entry<Integer, String> entry : treeMap.entrySet () ) { 

System.out.print (entry.getValue () + “ “); 

What is the result? 

A. A compilation error occurs. 

B. d b e z j 

C. j z e b d 

D. z b d e j 

Answer:


To know more about the 1Z0-809, click here.

Tagged as : Oracle 1Z0-809 Dumps, Download 1Z0-809 pdf, 1Z0-809 VCE, 1Z0-809 pass4sure, examcollection 1Z0-809