We provide real 1Z0-809 exam questions and answers braindumps in two formats. Download PDF & Practice Tests. Pass Oracle 1Z0-809 Exam quickly & easily. The 1Z0-809 PDF type is available for reading and printing. You can print more and practice many times. With the help of our Oracle 1Z0-809 dumps pdf and vce product and material, you can easily pass the 1Z0-809 exam.

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

Explanation: The DriverManager returns an instance of DoctrineDBALConnection 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 


Q12. Given the code fragment: 

List<String> colors = Arrays.asList(“red”, “green”, “yellow”); 

Predicate<String> test = n - > { 

System.out.println(“Searching…”); 

return n.contains(“red”); 

}; 

colors.stream() 

.filter(c -> c.length() > 3) 

.allMatch(test); 

What is the result? 

A. Searching… 

B. Searching… Searching… 

C. Searching… Searching… Searching… 

D. A compilation error occurs. 

Answer:


Q13. Given: What is the result? 

A. Initialized Started 

B. Initialized Started Initialized 

C. Compilation fails 

D. An exception is thrown at runtime 

Answer:


Q14. You want to create a singleton class by using the Singleton design pattern. Which two statements enforce the singleton nature of the design? 

A. Make the class static. 

B. Make the constructor private. 

C. Override equals() and hashCode() methods of the java.lang.Object class. 

D. Use a static reference to point to the single instance. 

E. Implement the Serializable interface. 

Answer: A,B 


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


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


Q17. Given: 

class UserException extends Exception { } 

class AgeOutOfLimitException extends UserException { } 

and the code fragment: 

class App { 

public void doRegister(String name, int age) 

throws UserException, AgeOutOfLimitException { 

if (name.length () < 6) { 

throw new UserException (); 

} else if (age >= 60) { 

throw new AgeOutOfLimitException (); 

} else { 

System.out.println(“User is registered.”); 

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

App t = new App (); 

t.doRegister(“Mathew”, 60); 

What is the result? 

A. User is registered. 

B. An AgeOutOfLimitException is thrown. 

C. A UserException is thrown. 

D. A compilation error occurs in the main method. 

Answer:


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


Q19. Given the definition of the Emp class: 

public class Emp 

private String eName; 

private Integer eAge; 

Emp(String eN, Integer eA) { 

this.eName = eN; 

this.eAge = eA; 

public Integer getEAge () {return eAge;} 

public String getEName () {return eName;} 

and code fragment: 

List<Emp>li = Arrays.asList(new Emp(“Sam”, 20), New Emp(“John”, 60), New Emp(“Jim”, 

51)); 

Predicate<Emp> agVal = s -> s.getEAge() > 50;//line n1 

li = li.stream().filter(agVal).collect(Collectors.toList()); 

Stream<String> names = li.stream()map.(Emp::getEName);//line n2 

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

What is the result? 

A. Sam John Jim 

B. John Jim 

C. A compilation error occurs at line n1. 

D. A compilation error occurs at line n2. 

Answer:


Q20. Given: 

class Vehicle { 

int vno; 

String name; 

public Vehicle (int vno, String name) { 

this.vno = vno,; 

this.name = name; 

public String toString () { 

return vno + “:” + name; 

and this code fragment: 

Set<Vehicle> vehicles = new TreeSet <> (); 

vehicles.add(new Vehicle (10123, “Ford”)); 

vehicles.add(new Vehicle (10124, “BMW”)); 

System.out.println(vehicles); 

What is the result? 

A. 10123 Ford 10124 BMW 

B. 10124 BMW 10123 Ford 

C. A compilation error occurs. 

D. A ClassCastException is thrown at run time. 

Answer: