The particular Oracle experts have the potential to get a professional in IT area also want to attain the maximum associated with ability as well as good results, so that they need to participate in various Oracle qualification examinations. Oracle 1Z0-804 named Java SE 7 Programmer II Exam will be stepping-stone to inspect the candidates knowledge as well as capacity in a appropriate area at work. Ucertify Oracle 1Z0-804 on the internet practice assessments can guarantee that you are able to control those highly skilled as well as skilled functions. Our own 1Z0-804 practice examination contains the actual questions, making certain you move the actual 1Z0-804 examination along with top grades.

2016 Jul book for 1z0-804:

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

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"); 

Answer: D,E 

Explanation: 

The Locale class provides a number of convenient constants that you can use to create 

Locale objects forcommonly used locales. 

For example, the following creates a Locale object for the United States: 

Locale.US 

E: Create a Locale object using the constructors in this class: 

Locale(String language) 

Locale(String language, String country) 

Locale(String language, String country, String variant) 

Reference: java.utilClass Locale 


Q82. Given the code fragment: 

What is the result of the employees table has no records before the code executed? 

A. 1 Sam 

B. 4 Jack 

C. 3 John 4 Jack 

D. 1 Sam 3 John 4 Jack 

Answer: C 

Explanation: 

AutoCommit is set to false. The two following statements will be within the same 

transaction. 

stmt.executeUpdate("insert into employees values(1,'Sam')"); 

stmt.executeUpdate("insert into employees values(2,'Jane')"); 

These two statements are rolled-back through (the savepoint is ignored! the savepoint 

must be specified (e.g. 

conn.rollback(save1); ) in the rollback if you want to rollback to the savepoint): 

conn.rollback() ; 

The next two insert statements are executed fine. Their result will be in the output. 


Q83. Given: 

What is the result? 

A. Event Quiz 

B. Event Event 

C. Quiz Quiz 

D. Quiz Event 

E. Compilation fails 

Answer: E 


Q84. Given the Greetings.properties file, containing: 

What is the result? 

A. Compilation fails 

B. HELLO_MSG 

C. GOODGYE_NSG 

D. Hello, everyone! 

E. Goodbye everyone! 

Answer: A 

Explanation: 

The code will not compile. 

The problem is the following line: 

System.out.println(resource.getObject(1)); 

In particular getObject(1) throws the following error: 

Exception in thread "main" java.lang.RuntimeException: Uncompilable source code -Erroneous sym type: 

<any>.loadResourceBundle 

Note:getObject(String key) !!! String keyGets an object for the given key from this resource 

bundle or one of its parents. 


Q85. Given: 

ConcurrentMap <String, String> PartList = new ConcurrentMap<>(); 

Which fragment puts a key/value pair in partList without the responsibility of overwriting an existing key? 

A. partList.out(key,"Blue Shirt"); 

B. partList.putIfAbsent(key,"Blue Shirt"); 

C. partList.putIfNotLocked (key,"Blue Shirt"); 

D. partList.putAtomic(key,"Blue Shirt") 

E. if (!partList.containsKey(key)) partList.put (key,"Blue Shirt"); 

Answer: B 

Explanation: 

putIfAbsent(K key, V value) 

If the specified key is not already associated with a value, associate it with the given value. 

Reference:java.util.concurrent,Interface ConcurrentMap<K,V> 


certifyforall.com

Up to date exams 1z0-803 & 1z0-804:

Q86. Which represents part of a DAO design pattern? 

A. interface EmployeeDAO { 

int getID(); 

Employee findByID (intid); 

void update(); 

void delete(); 

B. class EmployeeDAO { 

int getID() { return 0;} 

Employee findByID (int id) { return null;} 

void update () {} 

void delete () {} 

C. class EmployeeDAO { 

void create (Employee e) {} 

void update (Employee e) {} 

void delete (int id) {} 

Employee findByID (int id) {return id} 

D. interface EmployeeDAO { 

void create (Employee e); 

void update (Employee e); 

void delete (int id); 

Employee findByID (int id); 

E. interface EmployeeDAO { 

void create (Connection c, Employee e); 

void update (Connection c, Employee e); 

void delete (Connection c, int id); 

Employee findByID (Connection c, int id); 

Answer: D 


Q87. Which two properly implement a Singleton pattern? 

A. class Singleton { 

private static Singleton instance; 

private Singleton () {} 

public static synchronized Singleton getInstance() { 

if (instance == null) { 

instance = new Singleton (); 

return instance; 

B. class Singleton { 

private static Singleton instance = new Singleton(); 

protected Singleton () {} 

public static Singleton getInstance () { 

return instance; 

C. class Singleton { 

Singleton () {} 

private static class SingletonHolder { 

private static final Singleton INSTANCE = new Singleton (); 

public static Singleton getInstance () { 

return SingletonHolder.INSTANCE; 

D. enum Singleton { 

INSTANCE; 

Answer: A,D 

Explanation: 

A: Here the method for getting the reference to the SingleTon object is correct. 

B: The constructor should be private 

C: The constructor should be private 

Note: Java has several design patterns Singleton Pattern being the most commonly used. 

Java Singletonpattern belongs to the family of design patterns, that govern the instantiation process. This design patternproposes that at any time there can only be one instance of a singleton (object) created by the JVM. 

The class's default constructor is made private, which prevents the direct instantiation of the object by others(Other Classes). A static modifier is applied to the instance method that returns the object as it then makes thismethod a class level method that can be accessed without creating an object. OPTION A == SHOW THE LAZY initialization WITHOUT DOUBLE CHECKED LOCKING TECHNIQUE ,BUT ITS CORRECT OPTION D == Serialzation and thraead-safety guaranteed and with couple of line of code enum Singletonpattern is best way to create Singleton in Java 5 world. AND THERE ARE 5 WAY TO CREATE SINGLETON CLASS IN JAVA 1>>LAZY LOADING (initialization) USING SYCHRONIZATION 2>>CLASS LOADING (initialization) USINGprivate static final Singleton instance = new Singleton(); 3>>USING ENUM 4>>USING STATIC NESTED CLASS 5>>USING STATIC BLOCK AND MAKE CONSTRUCTOR PRIVATE IN ALL 5 WAY. 


Q88. Which two statements are true about RowSet subinterfaces? 

A. A JdbcRowSet object provides a JavaBean view of a result set. 

B. A CachedRowSet provides a connected view of the database. 

C. A FilteredRowSet object filter can be modified at any time. 

D. A WebRowSet returns JSON-formatted data. 

Answer: A,C 

Explanation: 

A: a JdbcRowSet object can be one of the Beans that a tool makes available for composing an application. Because a JdbcRowSet is a connected RowSet, that is, it continually maintains its connection to a databaseusing a JDBC technology-enabled driver, it also effectively makes the driver a JavaBeans component. 

C: The FilteredRowSet range criterion can be modified by applying a new Predicate object to the FilteredRowSet instance at any time. This is possible if no additional references to the FilteredRowSet objectare detected. A new filter has an immediate effect on criterion enforcement within the FilteredRowSet object,and all subsequent views and updates will be subject to similar enforcement. 

Reference: javax.sql Interface RowSet 


Q89. Given: What is the result? 

A. woof arf 

B. woof woof 

C. arf arf 

D. A RuntimeException is generated 

E. The code fails to compile 

Answer: E 

Explanation: 

class Dog { 

protected String bark() 

public class Beagle extends Dog { 

private String bark() 

Cannot reduce the visibility of the inherited method from Dog 


Q90. Given the code fragment: 

Assume that the SQL queries return records. What is the result of compiling and executing this code fragment? 

A. The program prints employee IDs 

B. The program prints customer IDs 

C. The program prints Error 

D. Compilation fails on line *** 

Answer: C 

Explanation: 

!!! The given Code prints Error -- the second query clears the ResultSet !? ErrorMessage: Operation notallowed after ResultSet closed 

It would print A, if second Query i set to rs = stmt.executeQuery("SELECT ID FROM Customer"); // Line *** It would print B, if Line *** is missing. // The program compiles and runs fine. Both executeQuery statements will run. The first executeQuery statement (ResultSet rs = stmt.executeQuery(query);) will set the rs Resultset. It will be used in the while loop. EmployIDswill be printed. Note: Executes the given SQL statement, which returns a single ResultSet object. Parameters:sql - an SQL statement to be sent to the database, typically a static SQL SELECT statement Returns:a ResultSet object that contains the data produced by the given query; never null