Check the style and quality of the material before you buy.
Question 1
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 () <= 60) {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: C
Question 2
What is true about the java.sql.Statement interface?
A. It provides a session with the database.
B. It is used to get an instance of a Connection object by using JDBC drivers.
C. It provides a cursor to fetch the resulting data. D. It provides a class for executing SQL statements and returning the results. Answer: D
D. It provides a class for executing SQL statements and returning the results.
Answer: D
Question 3
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: C
Question 4
Given:public class Customer {private String fName;private String lName;private static int count;public customer (String first, String last) {fName = first, lName = last;++count;}static { count = 0; }public static int getCount() {return count; }}public class App {public static void main (String [] args) {Customer c1 = new Customer(“Larry”, “Smith”);Customer c2 = new Customer(“Pedro”, “Gonzales”);Customer c3 = new Customer(“Penny”, “Jones”);Customer c4 = new Customer(“Lars”, “Svenson”);c4 = null;c3 = c2;System.out.println (Customer.getCount());}}What is the result?
A. 0
B. 2
C. 3
D. 4
E. 5
Answer: D
Question 5
Given the code fragment:List<String> empDetails = Arrays.asList(“100, Robin, HR”,“200, Mary, AdminServices”,“101, Peter, HR”);empDetails.stream().filter(s-> s.contains(“1”)).sorted().forEach(System.out::println); //line n1What is the result?
A. 100, Robin, HR101, Peter, HR
B. E. A compilation error occurs at line n1.
C. 100, Robin, HR101, Peter, HR200, Mary, AdminServices
D. 100, Robin, HR200, Mary, AdminServices101, Peter, HR
Answer: A
Question 6
Given the code fragment:List<String> listVal = Arrays.asList(“Joe”, “Paul”, “Alice”, “Tom”);System.out.println (// line n1);Which code fragment, when inserted at line n1, enables the code to print the count of stringelements whose length is greater than three?
A. listVal.stream().filter(x -> x.length()>3).count()
B. listVal.stream().map(x -> x.length()>3).count()
C. listVal.stream().peek(x -> x.length()>3).count().get()
D. listVal.stream().filter(x -> x.length()>3).mapToInt(x -> x).count()
Answer: A
Question 7
Given the code fragment:BiFunction<Integer, Double, Integer> val = (t1, t2) -> t1 + t2;//line n1System.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
Question 8
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 –da option?
A. -10
B. 0
C. An AssertionError is thrown.
D. A compilation error occurs.
Answer: A
Question 9
Given that /green.txt and /colors/yellow.txt are accessible, and the code fragment:Path source = Paths.get(“/green.txt);Path target = Paths.get(“/colors/yellow.txt);Files.move(source, target, StandardCopyOption.ATOMIC_MOVE);Files.delete(source);Which statement is true?
A. The green.txt file content is replaced by the yellow.txt file content and the yellow.txt fileis deleted.
B. The yellow.txt file content is replaced by the green.txt file content and an exception isthrown.
C. The file green.txt is moved to the /colors directory.
D. A FileAlreadyExistsException is thrown at runtime.
Answer: D
Question 10
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 successfullyWhat 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: D
Why Dumpsforsure is the best choice for Oracle 1z0-809 exam preparation
Secure your position in a competitive IT industry
The Oracle 1z0-809 certification is a strong way to demonstrate your understanding and ability. Our 1z0-809 questions & answers help you prepare for it, so you can secure your current position and move your career forward.
Reviewed by IT professionals
We keep our 1z0-809 exam dumps up to date, with explanations. The questions and answers on Dumpsforsure are reviewed by people with professional experience of Oracle technologies.
One place to prepare
Dumpsforsure brings together the material you need for the Oracle 1z0-809 exam. Explanations are added to the questions to help you understand the logic behind them and prepare for other Oracle exams.
Updated 1z0-809 questions & answers
We update the exam files regularly to add new questions. The date of the latest update is shown at the top of this page.
Free 1z0-809 demo before you buy
You can view sample 1z0-809 questions on this page before buying, to see the format and pattern of the material.
90 days of free updates
You are eligible for 90 days of free updates after buying the 1z0-809 exam. If the file is updated in that time, you can download the latest version from your account.