[Downloadable] 1Z0-805 Oracle test preparation 51-60 (Sep 2016)

Act now and download your Oracle 1Z0-805 test today! Do not waste time for the worthless Oracle 1Z0-805 tutorials. Download Most up-to-date Oracle Upgrade to Java SE 7 Programmer exam with real questions and answers and begin to learn Oracle 1Z0-805 with a classic professional.

2016 Sep 1Z0-805 Study Guide Questions:

Q51. Given: 

What two changes should you make to apply the DAO pattern to this class? 

A. Make the customer class abstract. 

B. Make the customer class an interface. 

C. Move the add, delete, find, and update methods into their own implementation class. 

D. Create an interface that defines the signatures of the add, delete, find and update command. 

E. Make the add, delete, find, and update methods private for encapsulation. 

F. Make the getName and getId methods private fir encapsulation. 

Answer: C,D 

Explanation: In computer software, a data access object (DAO) is an object that provides an abstract interface to some type of database or persistence mechanism, providing some specific operations without exposing details of the database. It provides a mapping from application calls to the persistence layer. This isolation separates the concerns of what data accesses the application needs, in terms of domain-specific objects and data types (the public interface of the DAO), and how these needs can be satisfied with a specific DBMS, database schema, etc. (the implementation of the DAO). 

In the specific context of the Java programming language, Data Access Objects as a design concept can be implemented in a number of ways. This can range from a fairly simple interface that separates the data access parts from the application logic, to frameworks and commercial products. 

Q52. How many Threads are created when passing tasks to an Executor Instance? 

A. A new Thread is used for each task. 

B. A number of Threads equal to the number of CPUs is used to execute tasks. 

C. A single Thread is used to execute all tasks. 

D. A developer-defined number of Threads Is used to execute tasks. 

E. A number of Threads determined by system load is used to execute tasks. 

F. The method used to obtain the Executor determines how many Threads are used to execute tasks. 

Answer: F 

Explanation: A simple way to create an executor that uses a fixed thread pool is to invoke the newFixedThreadPool factory method in java.util.concurrent.Executors This class also provides the following factory methods: 

* The newCachedThreadPool method creates an executor with an expandable thread pool. This executor is suitable for applications that launch many short-lived tasks. 

* The newSingleThreadExecutor method creates an executor that executes a single task at a time. 

* Several factory methods are ScheduledExecutorService versions of the above executors. 

If none of the executors provided by the above factory methods meet your needs, constructing instances of java.util.concurrent.ThreadPoolExecutor or java.util.concurrent.ScheduledThreadPoolExecutor will give you additional options. 

Note: The Executor interface provides a single method, execute, designed to be a drop-in replacement for a common thread-creation idiom. If r is a Runnable object, and e is an Executor object you can replace (new Thread(r)).start(); with e.execute(r); However, the definition of execute is less specific. The low-level idiom creates a new thread and launches it immediately. Depending on the Executor implementation, execute may do the same thing, but is more likely to use an existing worker thread to run r, or to place r in a queue to wait for a worker thread to become available. 

Reference: The Java Tutorials, Thread Pools 

Reference: The Java Tutorials, Executor Interfaces 

Q53. Given the code fragment: 

Locale loc1 = Locale.getDefault (); 

ResourceBundle messages = ResourceBundle.getBundle("MessageBundle", loc1); 

Which two statements are a valid way to re-assign a resource bundle to a different Locale? 

A. loc1 = ResourceBundle.getBundle ("MessageBundle", Locale.CHINA); 

B. loc1 = ResourceBundle.getBundle ("MessageBundle", new Locale ("es", "ES")); 

C. messages = ResourceBundle.getBundle ("messageBundle", new Locale ("es", "ES")); 

D. messages = ResourceBundle.getBundle ("MessageBundle", Locale.CHINA); 

Answer: C,D 

1Z0-805  study guide

Up to date 1Z0-805 testing engine:

Q54. Given the code fragment: 

try { 

String query = "SELECT * FROM Employee WHERE ID=110"; 

Statement stmt = conn.createStatement(); 

ResultSet rs = stmt.executeQuery(query); // Line 13 

System.out.println("Employee ID: " + rs.getInt("ID")); // Line 14 

} catch (Exception se) { 

System.out.println("Error"); 

Assume that the SQL query matches one record. What is the result of compiling and executing this code? 

A. The code prints error. 

B. The code prints the employee ID. 

C. Compilation fails due to an error at line 13. 

D. Compilation fails due to an error at line 14. 

Answer: B 

Explanation: Assuming that the connection conn has been set up fine, the code will compile and run fine. 

Note #1: The GetInt method retrieves the value of the designated column in the current row of this ResultSet object as an int in the Java programming language. 

Note 2: A table of data representing a database result set, which is usually generated by executing a statement that queries the database. 

A ResultSet object maintains a cursor pointing to its current row of data. Initially the cursor is positioned before the first row. The next method moves the cursor to the next row, and because it returns false when there are no more rows in the ResultSet object, it can be used in a while loop to iterate through the result set. 

A default ResultSet object is not updatable and has a cursor that moves forward only. Thus, you can iterate through it only once and only from the first row to the last row. It is possible to produce ResultSet objects that are scrollable and/or updatable. 

Reference: The Java Tutorials, Interface ResultSet 

Q55. Given a language code of fr and a country code of FR, while file name represents a resource bundle file name that is not the default? 

A. MessageBundle_fr_FR.properties 

B. MessageBundle_fr_FR.Profile 

C. MessageBundle_fr_FR.Xml 

D. MessageBundle_fr_FR.Java 

E. MessageBundle_fr_FR.locale 

Answer: A 

Explanation: A properties file is a simple text file. You can create and maintain a properties file with just about any text editor. You should always create a default properties file. The name of this file begins with the base name of your ResourceBundle and ends with the .properties suffix. To support an additional Locale, your localizers will create a new properties file that contains the translated values. No changes to your source code are required, because your program references the keys, not the values. 

For example, to add support for the German language, your localizers would translate the values in LabelsBundle.properties and place them in a file named LabelsBundle_de.properties. Notice that the name of this file, like that of the default file, begins with the base name LabelsBundle and ends with the .properties suffix. 

Reference: The Java Tutorials, Backing a ResourceBundle with Properties Files 

Q56. Which two code blocks correctly initialize a Locale variable? 

A. Locale loc1 = "UK"; 

B. Locale loc2 = Locale.get Instance ( "ru" ); 

C. Locale loc3 = Locale.getLocaleFactory("RU"); 

D. Locale loc4 = Locale.UK; 

E. Locale loc5 = new Locale("ru", "RU"); 

Answer: D,E 

Reference: The Java Tutorials, Creating a Locale 

certleader.com

Realistic 1Z0-805 cram:

Q57. Which method or methods should you implement to create your own implementation of the java.nio.file.PathMatcher interface? 

A. matches(Path) 

B. matches(Path), fails(Path) 

C. matches(Path) , fails(Path), enable(boolean) 

D. matches(Path) , fails(Path) , setPreferred (String) 

Answer: A 

Explanation: The interface PathMatcher is an interface that is implemented by objects that 

perform match operations on paths. 

The single method for this interface is matches: 

boolean matches(Path path) 

Tells if given path matches this matcher's pattern. 

Parameters: 

path – the path to match 

Returns: 

true if, and only if, the path matches this matcher's pattern. 

Reference: java.nio.file.PathMatcher 

Q58. Which two scenarios throw FileSystemNotFoundException when the paths.get(URI) method is invoked? 

A. When preconditions on the uri parameter do not hold 

B. When the provider identified by the URI’S scheme component is not installed 

C. When a security manager is installed and it denies an unspecified permission to acess the file system. 

D. When the file system identified by the uri does not exist and cannot be created automatically 

E. When the path string cannot be converted to a Path 

Answer: B,D 

Explanation: The file system, identified by the URI, does not exist and cannot be created automatically, or the provider identified by the URI's scheme component is not installed. 

Note: This method converts the given URI to a Path object. It throws the following exceptions: 

* IllegalArgumentException – if preconditions on the uri parameter do not hold. The format of the URI is provider specific. 

* FileSystemNotFoundException – The file system, identified by the URI, does not exist and cannot be created automatically, or the provider identified by the URI's scheme component is not installed 

* SecurityException – if a security manager is installed and it denies an unspecified permission to access the file system 

Reference: java.nio.file.Paths 

Q59. Given: 

public class StringApp { 

public static void main(String[] args) { 

String[] str="Java SE,java EE,Java ME,java FX".split(","); 

int count=0; 

for(int i=0;i<str.length;i++) { 

switch(str[i]) { 

case "Java SE": 

count++; continue; 

case "Java EE": 

count++; break; 

case "Java ME": 

count++; break; 

case "Java FX": 

count++; break; 

System.out.println("Total match found="+count); 

What is the result? 

A. 1 

B. 2 

C. 3 

D. 4 

Answer: B 

Explanation: Java SE and Java ME will increase the count variable as it matches. java EE and java FX does not match. 

Q60. Given: 

Person 

public Person(int id) 

public int getid() 

public String getContactDetails() 

public void setContactDetails(String contactDetails) 

public String getName() 

public void setName(String name) 

public Person getPerson(int id) throws Exception 

public void createPerson(int id) throws Exception 

public Person deletePerson(int id) throws Exception 

public void updatePerson(Person p) throws Exception 

Which group of methods is moved to a new class when implementing the DAO pattern? 

A. public int getId () 

public String getContractDetails () 

public void setContactDetails (String ContactDetails) 

public void getName () 

public Person setName (String name) 

B. public int getId () 

public String getContractDetails () 

public void getName () 

public person getPerson (int id) throws Exception 

C. public void setContactDetails(String contactDetails) 

public void setName (String name) 

D. public person getPerson(int id) throws Exception 

public void createPerson (person p) throws exception 

public void deleteperson(int id) throws Exception 

public void updatePerson (Person p) throws Exception 

Answer: D 

Explanation: We move the most abstract highest level methods into a separate class. 

Note: Data Access Object 

Abstracts and encapsulates all access to a data source 

Manages the connection to the data source to obtain and store data 

Makes the code independent of the data sources and data vendors (e.g. plain-text, xml, 

LDAP, MySQL, Oracle, DB2) 

About 1Z0-805 Information: 1Z0-805 Dumps

Certleader Dumps
Certleader is a company specialized on providing high quality IT exam materials and fully committed to assist our respected clients crack any IT certification tests on their 1st efforts.