Oracle 1Z0-809 Certification Sample Questions and Answers

1Z0-809 PDF, 1Z0-809 Dumps PDF Free Download, 1Z0-809 Latest Dumps Free PDF, Java SE Programmer II PDF DumpsThe Oracle Java SE Programmer II (1Z0-809) Sample Question Set is designed to help you prepare for the Oracle Certified Professional Java SE 8 Programmer (OCP) certification exam. To become familiar with the actual Oracle Certification exam environment, we suggest you try our Sample Oracle 1Z0-809 Certification Practice Exam.

This Oracle Java SE 8 Programmer II certification sample practice test and sample question set are designed for evaluation purposes only. If you want to test your Oracle 1Z0-809 knowledge to identify your areas of improvement and get familiar with the actual exam format, we suggest you prepare with the Premium Oracle Certified Professional Java SE 8 Programmer (OCP) Certification Practice Exam. Our team of Oracle Java experts has designed Questions-Answers for this premium practice exam by collecting inputs from recently certified candidates. Our premium Oracle 1Z0-809 certification practice exam will boost your confidence as well as your actual Oracle Professional Java SE 8 Developer exam result.

Oracle 1Z0-809 Sample Questions:

01. Assuming that the file /data/december/log.txt does not exist, and given the code fragment:
import java.nio.file.*;
import java.io.IOException;
class MyClass {
public static void main(String[] args) throws IOException {
Path source = Paths.get("/data/december/log.txt");
Path destination = Paths.get("/data");
Files.copy(source, destination);
}
}
a) A NoSuchFileException is thrown at runtime.
b) The program executes successfully and does not change the file system.
c) A FileNotFoundException is thrown at runtime.
d) A file named log.txt is created in /data and its contents are copied from /data/december/log.txt.
 
02. Which statement is true about the DriverManager class?
a) It only queries metadata of the database.
b) None of the above.
c) It executes SQL statements against the database.
d) It returns an instance of Connection.
 
03. What will be the output of the following program?
import java.util.Locale;
class myClass {
public static void main(String []args) {
Locale l1 = new Locale("en"); // line 1
Locale l2 = new Locale("it", "IT"); // line 2
Locale l3 = new Locale("fi", "FI", "FI"); // line 3
Locale l4 = new Locale(l3); // line 4
System.out.println(l1 + " " + l2 + " " + l3 + " " + l4);
}
}
a) Compilation Error line 1
b) Compilation Error line 4
c) Compilation Error line 3
d) Compilation Error line 2
 
04. Which one of the following statements correctly instantiates a Locale object?
a) Locale l2 = new Locale(Locale.US);
b) Locale l3 = Locale("US");
c) Locale l4 = Locale.US;
d) Locale l1 = new Locale.US;
 
05. Which two code blocks correctly initialize a Locale variable?
(Choose two.)
a) Locale loc1 = "UK";
b) Locale loc2 = Locale.getInstance("ru");
c) Locale loc3 = Locale.getLocaleFactory("RU");
d) Locale loc4 = Locale.UK;
e) Locale loc5 = new Locale ("ru", "RU");
 
06. Which of the following classes in the java.util.concurrent.atomic package inherit from java.lang.Number?
a) AtomicBoolean
b) AtomicInteger
c) AtomicFloat
d) AtomicDouble
 
07. Which action can be used to load a database driver by using JDBC 3.0?
a) Use the java.lang.Class.forName method to load the driver class.
b) Use the DriverManager.getDriver method to load the driver class.
c) Add the driver class to the META-INF/services folder of the JAR file.
d) Include the JDBC driver class in a jdbc.properties file.
 
08. Path file = Paths.get("courses.txt");
// line n1
Assume courses.txt is accessible. Which code fragment can be inserted at line n1 to print the content of the courses.txt file?
a) List<String> fc = Files.list(file); fc.stream().forEach(s -> System.out.println(s));
b) Stream<String> fc = Files.readAllLines(file); fc.forEach(s -> System.out.println(s));
c) List<String> fc = readAllLines(file); fc.stream().forEach(s -> System.out.println(s));
d) Stream<String> fc = Files.lines(file); fc.forEach(s -> System.out.println(s));
 
09. Which one of the following statements correctly instantiates a Statement object?
a) Statement s = connection.newStatement();
b) Statement s = connection.createStatement();
c) Statement s = connection.getStatementInstance();
d) Statement s = connection.getStatement();
 
10. Which method returns the locale of the running program?
a) Locale.get("default")
b) Locale.get(Locale.DEFAULT)
c) Locale.getDefault()
d) None of the above

Answers:

Question: 01

Answer: a

Question: 02

Answer: d

Question: 03

Answer: b

Question: 04

Answer: c

Question: 05

Answer: d, e

Question: 06

Answer: b

Question: 07

Answer: a

Question: 08

Answer: d

Question: 09

Answer: b

Question: 10

Answer: c

 

Rating: 4.9 / 5 (77 votes)