Actualtests offers free demo for 1Z0-804 exam. "Java SE 7 Programmer II Exam", also known as 1Z0-804 exam, is a Oracle Certification. This set of posts, Passing the Oracle 1Z0-804 exam, will help you answer those questions. The 1Z0-804 Questions & Answers covers all the knowledge points of the real exam. 100% real Oracle 1Z0-804 exams and revised by experts!

Q1. 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 


Q2. Which statement declares a generic class? 

A. public class Example < T > { } 

B. public class <Example> { } 

C. public class Example <> { } 

D. public class Example (Generic) { } 

E. public class Example (G) { } 

F. public class Example { } 

Answer:

Explanation: 

Example: 

public class Pocket<T> 

private T value; 

public Pocket() {} 

public Pocket( T value ) { this.value = value; } 

public void set( T value ) { this.value = value; } 

public T get() { return value; } 

public boolean isEmpty() { return value != null; } 

public void empty() { value = null; } 


Q3. 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:


Q4. Given: 

What two changes, made independently, will enable the code to compile? 

A. Change the signature of Account to: public class Account. 

B. Change the signature of CheckingAccount to: public abstract CheckingAccount 

C. Implement private methods for deposit and withdraw in CheckingAccount. 

D. Implement public methods for deposit and withdraw in CheckingAccount. 

E. Change Signature of checkingAccount to: CheckingAccount implements Account. 

F. Make Account an interface. 

Answer: B,D 

Explanation: 

Compiler say: 

-

Der Typ CheckingAccount muss die übernommene abstrakte Methode Account.deposit(double) implementieren 

-

Der Typ CheckingAccount muss die übernommene abstrakte Methode Account.withdraw(double) implementieren ODER Typ CheckingAccount als abstract definieren 


Q5. Given: 

What is the result? 

A. Event Quiz 

B. Event Event 

C. Quiz Quiz 

D. Quiz Event 

E. Compilation fails 

Answer:


Q6. Given: 

What is the result? 

A. Cue sports, Cue sports 

B. Compilation fails at line 9 

C. Compilation fails at line 11 

D. Compilation fails at line 12 

E. Compilation fails at line 13 

Answer:

Explanation: 

Class Snooker is public. Should be declared in a separate file. // Line 9 getCategory() >>> GetCategory() Line 13 


Q7. Given: 

And the command-line invocation: 

Java Tracker 12 11 

What is the result? 

A. General category 

B. class InvalidAgeException 

C. class java.lang.IllegalArgumentException 

D. class java.lang.RuntimeException 

Answer:

Explanation: 

The second argument 11 makes the program to throw an InvalidAgeException due to the 

line: 

if (age < 12) 

throw new InvalidAgeException (); 


Q8. Which is a factory method from the java.text.NumberFormat class? 

A. format (long number) 

B. getInstance() 

C. getMaxiraumFractionDigits () 

D. getAvailableLocales () 

E. isGroupingUsed() 

Answer:

Explanation: 

To obtain a NumberFormat for a specific locale, including the default locale, call one ofNumberFormat's factory methods, such as getInstance(). Reference:java.textClass DecimalFormat