Top Accurate 1Z0-809 discount pack Tips!

Your success in Oracle 1Z0-809 is our sole target and we develop all our 1Z0-809 braindumps in a way that facilitates the attainment of this target. Not only is our 1Z0-809 study material the best you can find, it is also the most detailed and the most updated. 1Z0-809 Practice Exams for Oracle Java 1Z0-809 are written to the highest standards of technical accuracy.

Q61. Given the content of /resourses/Message.properties: 

welcome1=”Good day!” 

and given the code fragment: 

Properties prop = new Properties (); 

FileInputStream fis = new FileInputStream (“/resources/Message.properties”); 

prop.load(fis); 

System.out.println(prop.getProperty(“welcome1”)); 

System.out.println(prop.getProperty(“welcome2”, “Test”));//line n1 

System.out.println(prop.getProperty(“welcome3”)); 

What is the result? 

A. Good day! 

Test 

followed by an Exception stack trace 

B. Good day! 

followed by an Exception stack trace 

C. Good day! 

Test 

null 

D. A compilation error occurs at line n1. 

Answer:


Q62. Given: 

class Bird { 

public void fly () { System.out.print(“Can fly”); } 

class Penguin extends Bird { 

public void fly () { System.out.print(“Cannot fly”); } 

and the code fragment: 

class Birdie { 

public static void main (String [ ] args) { 

fly( ( ) -> new Bird ( )); 

fly (Penguin : : new); 

/* line n1 */ 

Which code fragment, when inserted at line n1, enables the Birdie class to compile? 

A. static void fly (Consumer<Bird> bird) { 

bird :: fly (); } 

B. static void fly (Consumer<? extends Bird> bird) { 

bird.accept( ) fly (); 

C. static void fly (Supplier<Bird> bird) { 

bird.get( ) fly (); 

D. static void fly (Supplier<? extends Bird> bird) { 

LOST 

Answer:

Explanation: NOTE: Very confusing question. There is no logic in the options. 


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


Q64. Given: 

public class Counter { 

public static void main (String[ ] args) { 

int a = 10; 

int b = -1; 

assert (b >=1) : “Invalid Denominator”; 

int = a / b; 

System.out.println (c); 

What is the result of running the code with the –ea option? 

A. -10 

B. 0 

C. An AssertionError is thrown. 

D. A compilation error occurs. 

Answer:


Q65. Given the code fragment: 

Path source = Paths.get (“/data/december/log.txt”); 

Path destination = Paths.get(“/data”); 

Files.copy (source, destination); 

and assuming that the file /data/december/log.txt is accessible and contains: 

10-Dec-2014 – Executed successfully 

What is the result? 

A. A file with the name log.txt is created in the /data directory and the content of the /data/december/log.txt file is copied to it. 

B. The program executes successfully and does NOT change the file system. 

C. A FileNotFoundException is thrown at run time. 

D. A FileAlreadyExistsException is thrown at run time. 

Answer:


Q66. Given: 

interface Rideable {Car getCar (String name); } 

class Car { 

private String name; 

public Car (String name) { 

this.name = name; 

Which code fragment creates an instance of Car? 

A. Car auto = Car (“MyCar”): : new; 

B. Car auto = Car : : new; 

Car vehicle = auto : : getCar(“MyCar”); 

C. Rideable rider = Car : : new; 

Car vehicle = rider.getCar(“MyCar”); 

D. Car vehicle = Rideable : : new : : getCar(“MyCar”); 

Answer:


Q67. Given: 

Class A { } Class B { } Interface X { } 

Interface Y { } 

Which two definitions of class C are valid? 

A. Class C extends A implements X { } 

B. Class C implements Y extends B { } 

C. Class C extends A, B { } 

D. Class C implements X, Y extends B { } 

E. Class C extends B implements X, Y { } 

Answer: A,E 

Explanation: extends is for extending a class. 

implements is for implementing an interface. Java allows for a class to implement many interfaces. 


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


Q69. public class ForTest { 

public static void main(String[] args) { 

int[] arrar = {1,2,3}; 

for ( foo ) { 

Which three are valid replacements for foo so that the program will compiled and run? 

A. int i: array 

B. int i = 0; i < 1; i++ 

C. ;; 

D. ; i < 1; i++ 

E. ; i < 1; 

Answer: A,B,C 


Q70. Given: 

public final class IceCream { 

public void prepare() {} 

public class Cake { 

public final void bake(int min, int temp) {} 

public void mix() {} 

public class Shop { 

private Cake c = new Cake (); 

private final double discount = 0.25; 

public void makeReady () { c.bake(10, 120); } 

public class Bread extends Cake { 

public void bake(int minutes, int temperature) {} 

public void addToppings() {} 

Which statement is true? 

A. A compilation error occurs in IceCream. 

B. A compilation error occurs in Cake. 

C. A compilation error occurs in Shop. 

D. A compilation error occurs in Bread 

E. All classes compile successfully. 

Answer:



see more http://www.certshared.com/exam/1Z0-809/

Oracle 1Z0-809 Certification Sample Questions and Answers: http://www.braindumpsall.net/1Z0-809-dumps/

P.S. New 1Z0-809 dumps PDF: http://www.4easydumps.com/1Z0-809-dumps-download.html