1Z0-805 Exam Questions
95 real 1Z0-805 exam questions with expert-verified answers and explanations. Page 1 of 2.
- Question #1
Given the following code fragment: public class Calc { public static void main (String [] args) { //* insert code here Line ** System.out.print("The decimal value is" + var); } } W...
- Question #2
Given the code fragment: String query = "SELECT ID FROM Employee"; \\ Line 1 try (Statement stmt = conn.CreateStatement()) { \\ Line 2 ResultSet rs = stmt.executeQuery(query); \\ L...
- Question #3
Given: public class SampleClass { public static void main(String[] args) { SampleClass sc = new SampleClass(); sc.processCD(); } Oracle 1Z0-805 Exam private void processCD() { try...
- Question #4
Given the code fragment: SimpleDateFormat sdf; Oracle 1Z0-805 Exam Which code fragment displays the three-character month abbreviation?
- Question #5
Given the code fragment: public static void processFile () throws IOException { Try (FileReader fr = new FileReader ("logfilesrc.txt"); FileWriter fw = new FileWriter ("logfilesdst...
- Question #6
Given this code fragment: ResultSet rs = null; try (Connection conn = DriverManager. getConnection (url) ) { Statement stmt = conn.createStatement(); rs stmt.executeQuery(query); /...
- Question #7
View the Exhibit: Given the following code fragment: class Finder extends SimpleFileVisitor<Path> { private final PathMatcher matcher; private static int numMatches = 0; Finder() {...
- Question #8
Given the following code fragment: public static void main(String[] args) { Path tempFile = null; try { Path p = Paths.get("emp"); tempFile = Files.createTempFile(p, "report", ".tm...
- Question #9
Which two Capabilities does Java.util.concurcent.BlockingQueue provide to handle operation that cannot be handled immediately?
- Question #10
Which is true regarding the java.nio.file.Path Interface?
- Question #11
What are two benefits of a Factory design pattern?
- Question #12
Given the code fragment: SimpleDateFormat sdf = new SimpleDateFormat("zzzz", Locale.US); Oracle 1Z0-805 Exam System.out.println ("Result: " + sdf.format(today) ) ; What type of res...
- Question #13
The advantage of a CallableStatement over a PreparedStatement is that it:
- Question #14
Given: class Fibonacci extends RecursiveTask<Integer> { final int n; Fibonacci (int n) { this.n = n } Integer compute () { if (n <= 1) return n; Fibonacci f1 = new Fibonacci (n ?1)...
- Question #15
Given: public static void main(String[] args) throws Exception { try { processFile(); } catch(Exception e) { Throwable [] t = e.getSuppressed(); } } public static void processFile(...
- Question #16
Given the code fragment: 11. public static getFileSize () throws IOException { 12. path file = paths.get ("ex.txt"); 13. //insert code here 14. System.out.println ("size: " + attr....
- Question #17
Which two statements are true about RowSet subinterfaces?
- Question #18
Given the code fragment: public static void main(String[] args) { Path dir = Paths.get("d:\\company"); // insert code here. Line ** for (Path entry: stream) { System.out.println(en...
- Question #19
Consider the following five methods: Which method should you use to connect to a java Db database with JDBC 4.0, but not with previous versions of JDBC?
- Question #20
Given the code fragment: Locale loc1 = Locale.getDefault (); ResourceBundle messages = ResourceBundle.getBundle("MessageBundle", loc1); Which two statements are a valid way to re-a...
- Question #21
Given: public class TemperatureSensor { public TemperatureSensor () { } public double getCurrTemp () { // . . . method to retrieve temperature from a sensor Return temp; } } Which...
- Question #22
Given the error message when running you application: Exception in thread "main" java.util.MissingResourceException: can't find bundle for base name messageBundle, Locale And given...
- Question #23
Which two statements are true regarding the try with resources statement?
- Question #24
Given the code fragment: public class TestString { public static void main(String[] args) { String str=null; switch(str) { case "": System.out.println("blank"); break; case "null":...
- Question #25
Given the code fragment: try { String query = "SELECT * FROM Employee WHERE ID=110"; Statement stmt = conn.createStatement(); ResultSet rs = stmt.executeQuery(query); // Line 13 Sy...
- Question #26
Given the code fragment: Path path1 = Paths.get("D:\\sales\\.\\quarterly\\..\\report"); path1 = path1.normalize(); Path path2 = path1.relativize(Paths.get("d:\\empdetails.dat")); p...
- Question #27
Given: Which design pattern moves the getPerson, createPerson, deletePerson, and updatePerson methods to a new class?
- Question #28
Given: ConcurrentMap<String, String> partList = new ConcurrentHashMap<> (); Which fragment puts a key/value pair in partList without the possibility of overwriting an existing Orac...
- Question #29
Which three objects must a vendor provide implementations in its JDBC driver?
- Question #30
Given: public class MyGrades { private final List<Integer> myGrades = new ArrayList<Integer>(); private final ReadWriteLock rwlock = new ReentrantReadWriteLock(); public void addGr...
- Question #31
Which two methods are defined in the FileStore class print disk space information?
- Question #32
Given the code fragment: public static void main(String[] args) { Path file = Paths.get("D:\\company\\report.txt"); Oracle 1Z0-805 Exam try (SeekableByteChannel sbc = Files.newByte...
- Question #33
Which statement is true about the take method defined in the WatchService interface?
- Question #34
Given the code fragment: private static void copyContents (File source, File target) { try {inputStream fis = new FileInputStream(source); outputStream fos = new FileOutputStream (...
- Question #35
Which two statements are true about the walkFileTree method of the files class?
- Question #36
Which code fragments print 1?
- Question #37
Given the code fragment: public static void main(String[] args) { String source = "d:\\company\\info.txt"; String dest = "d:\\company\\emp\\info.txt"; //insert code fragment here L...
- Question #38
What design pattern does the Drivermanager.getconnection () method characterize?
- Question #39
Given the code fragment: dataFormat df; Oracle 1Z0-805 Exam Which statement defines a new DataFormat object that displays the default date format for the UK Locale?
- Question #40
Given three resource bundles with these values set for menu1: ( The default resource bundle is written in US English.) English US resource Bundle Menu1 = small French resource Bund...
- Question #41
Given: import java.util.*; public class StringApp { public static void main (String [] args) { Set <String> set = new TreeSet <> (); set.add("X"); set.add("Y"); set.add("X"); set.a...
- Question #42
Given the code fragment: List<Person> pList = new CopyOnWriteArrayList<Person>(); Which statement is true?
- Question #43
Given the fragment: public class CustomerApplication { Oracle 1Z0-805 Exam public static void main (String [] args) { CustomerDAO custDao = new CustomerDAOMemoryImp1 (); // . . . o...
- Question #44
Given a resource bundle MessageBundle, what is the name of the default bundle file?
- Question #45
Given the code fragment: public class Test { public static void main (String [] args) { Path path1 = Paths.get("D:\\sys\\asm\\.\\data\\..\\..\\mfg\\production.log"); System.out.pri...
- Question #46
You are using a database from XY/Data. What is a prerequisite for connecting to the database using a JDBC 4.0 driver from XY/Data?
- Question #47
Oracle 1Z0-805 Exam Two companies with similar robots have merged. You are asked to construct a new program that allows the features of the robots to be mixed and matched using com...
- Question #48
Which three must be used when using the Java.util.concurrent package to execute a task that returns a result without blocking?
- Question #49
Which statement creates a low-overhead, low contention random number generator that is isolated to a thread to generate a random number between 1 and 100?
- Question #50
Given: public class DataCache { private static final DataCache instance = new DataCache (); public static DataCache getInstance () { return instance; } } Which design pattern best...