Approved of 1Z0-809 free question materials and cram for Oracle certification for consumer, Real Success Guaranteed with Updated 1Z0-809 pdf dumps vce Materials. 100% PASS Java SE 8 Programmer II exam Today!

2016 Jun 1Z0-809 test questions

Q1. 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: D 


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


Q3. Given the code fragment: 

public class FileThread implements Runnable { 

String fName; 

public FileThread(String fName) { this.fName = fName; } 

public void run () System.out.println(fName);} 

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

ExecutorService executor = Executors.newCachedThreadPool(); 

Stream<Path> listOfFiles = Files.walk(Paths.get(“Java Projects”)); 

listOfFiles.forEach(line -> { 

executor.execute(new FileThread(line.getFileName().toString())); // 

line n1 

}); 

executor.shutdown(); 

executor.awaitTermination(5, TimeUnit.DAYS);// 

line n2 

The Java Projects directory exists and contains a list of files. 

What is the result? 

A. The program throws a runtime exception at line n2. 

B. The program prints files names concurrently. 

C. The program prints files names sequentially. 

D. A compilation error occurs at line n1. 

Answer: A 


Q4. Which action can be used to load a database driver by using JDBC3.0? 

A. Add the driver class to the META-INF/services folder of the JAR file. 

B. Include the JDBC driver class in a jdbc.properties file. 

C. Use the java.lang.Class.forName method to load the driver class. 

D. Use the DriverManager.getDriver method to load the driver class. 

Answer: D 


Q5. Which statement is true about the DriverManager class? 

A. It returns an instance of Connection. 

B. it executes SQL statements against the database. 

C. It only queries metadata of the database. 

D. it is written by different vendors for their specific database. 

Answer: A 

Explanation: The DriverManager returns an instance of Doctrine\DBAL\Connection which is a wrapper around the underlying driver connection (which is often a PDO instance). Reference: http://doctrine-dbal.readthedocs.org/en/latest/reference/configuration.html 


certifyforall.com

Far out 1Z0-809 rapidshare:

Q6. Given the code fragments: 

4. 

void doStuff() throws ArithmeticException, NumberFormatException, Exception { 

5. 

if (Math.random() >-1 throw new Exception (“Try again”); 

6. 

} and 

24. 

try { 

25. 

doStuff ( ): 

26. 

} catch (ArithmeticException | NumberFormatException | Exception e) { 

27. 

System.out.println (e.getMessage()); } 

28. 

catch (Exception e) { 

29. 

System.out.println (e.getMessage()); } 

30. 

Which modification enables the code to print Try again? 

A. Comment the lines 28, 29 and 30. 

B. Replace line 26 with: 

} catch (Exception | ArithmeticException | NumberFormatException e) { 

C. Replace line 26 with: 

} catch (ArithmeticException | NumberFormatException e) { 

D. Replace line 27 with: 

throw e; 

Answer: C 


Q7. Given: 

A. X XX 

B. X Y X 

C. Y Y X 

D. Y YY 

Answer: D 


Q8. Given the code fragment: 

List<Integer> nums = Arrays.asList (10, 20, 8): 

System.out.println ( 

//line n1 

); 

Which code fragment must be inserted at line n1 to enable the code to print the maximum number in the nums list? 

A. nums.stream().max(Comparator.comparing(a -> a)).get() 

B. nums.stream().max(Integer : : max).get() 

C. nums.stream().max() 

D. nums.stream().map(a -> a).max() 

Answer: C 


Q9. Given: 

public interface Moveable<Integer> { 

public default void walk (Integer distance) {System.out.println(“Walking”);) 

public void run(Integer distance); 

Which statement is true? 

A. Moveable can be used as below: 

Moveable<Integer> animal = n - > System.out.println(“Running” + n); 

animal.run(100); 

animal.walk(20); 

B. Moveable can be used as below: 

Moveable<Integer> animal = n - > n + 10; 

animal.run(100); 

animal.walk(20); 

C. Moveable can be used as below: 

Moveable animal = (Integer n) - > System.out.println(n); 

animal.run(100); 

Moveable.walk(20); 

D. Movable cannot be used in a lambda expression. 

Answer: B 


Q10. Given: 

What is the result? 

A. 6 7 8 

B. 7 8 9 

C. 0 1 2 

D. 6 8 10 

E. Compilation fails 

Answer: A