All About 1Z0-804 exam topics Feb 2021

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


♥♥ 2021 NEW RECOMMEND ♥♥

Free VCE & PDF File for Oracle 1Z0-804 Real Exam (Full Version!)

★ Pass on Your First TRY ★ 100% Money Back Guarantee ★ Realistic Practice Exam Questions

Free Instant Download NEW 1Z0-804 Exam Dumps (PDF & VCE):
Available on: http://www.surepassexam.com/1Z0-804-exam-dumps.html

Q31. Given: 

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

A. public in getId () 

public String getContractDetails () 

public Void setContractDetails(String contactDetails) 

public String getName () 

public void setName (String name) 

B. public int getId () 

public String getContractDetails() 

public String getName() 

public Person getPerson(int id) throws Exception 

C. public void setContractDetails(String contractDetails) 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:

Explanation: 

The methods related directly to the entity Person is moved to a new class. 

CRUD 

Note:DAO Design Pattern 

*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) 

D:\Documents and Settings\useralbo\Desktop\1.jpg 

Example (here Customer is the main entity): 

public class Customer { 

private final String id; 

private String contactName; 

private String phone; 

public void setId(String id) { this.id = id; } 

public String getId() { return this.id; } 

public void setContactName(String cn) { this.contactName = cn;} public String 

getContactName() { return 

this.contactName; } public void setPhone(String phone) { this.phone = phone; } public 

String getPhone() 

{ return this.phone; } 

public interface CustomerDAO { 

public void addCustomer(Customer c) throws DataAccessException; public Customer 

getCustomer(String id) 

throws DataAccessException; public List getCustomers() throws DataAccessException; 

public void 

removeCustomer(String id) throws DataAccessException; public void 

modifyCustomer(Customer c) throws 

DataAccessException; } 


Q32. Given: 

Which two are true about the lines labeled A through D? 

A. The code compiles and runs as is. 

B. If only line A is removed, the code will compile and run. 

C. If only line B is removed, the code will compile and run. 

D. If only line D is removed, the code will compile and run. 

E. Line C is optional to allow the code to compile and run. 

F. Line C is mandatory to allow the code to compile andrun. 

Answer: A,E Explanation: 

A: The code will compile. The abstract method doDock() is implemented fine, and doFloat() isoverridden. 

E: Line C overrides the implementation of doFloat(). This is optional. 


Q33. Given: What is the most likely result? 

A. size: 4, elements: 11 22 33 44 

B. size: 5, elements: 11 22 33 44 

C. size: 4, elements: 11 22 33 44 77 

D. size: 5, elements: 11 22 33 44 77 

E. a ConcurrentModification Exception is thrown 

Answer:


Q34. The default file system includes a logFiles directory that contains the following files: 

Log-Jan 2009 

log_0l_20l0 

log_Feb20l0 

log_Feb2011 

log_10.2012 

log-sum-2012 

How many files does the matcher in this fragment match? 

PathMatcher matcher = FileSystems.getDefault ().getPathMatcher ("glob: *???_*1?" ); 

A. One 

B. Two 

C. Three 

D. Four 

E. Five 

F. Six 

Answer:

Explanation: 

The pattern to match is *???_*1? (regex ".*..._.*1.") 

This means at least three characters before the symbol _ , followed by any amount of 

characters. The next tolast character must be 1. The last character can by any character. 

The following file names match this pattern: 

log_Feb2011 

log_10.2012 Trap !! l is not 1 !! 


Q35. Which four are true about enums? 

A. An enum is typesafe. 

B. An enum cannot have public methods or fields. 

C. An enum can declare a private constructor. 

D. All enums implicitly implement Comparable. 

E. An enum can subclass another enum. 

F. An enum can implement an interface. 

Answer: A,C,D,F Explanation: 

C: The constructor for an enum type must be package-private or private access. Reference: Java Tutorials,Enum Types 


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


Q37. Given: What is the result? 

A. doc 

B. index.html 

C. an IllegalArgumentException is thrown at runtime. 

D. An InvalidPthException is thrown at runtime. 

E. Compilation fails. 

Answer:

Explanation: 

p.getName(int location) = returns path' name element by index/location (starts with 0) 

Example: 

path = "project//doc//index.html" 

p.getName(0) = project 

p.getName(1) = doc 

p.getName(2) = index.html 


Q38. Given: 

Which statement, inserted at line 8, enables the code to compile? 

A. new Task().new Counter().increment(); 

B. new Task().Counter().increment(); 

C. new Task.Counter().increment(); 

D. Task.Counter().increment(); 

E. Task.Counter.increment(); 

Answer:


Q39. Which two forms of abstraction can a programmer use in Java? 

A. enums 

B. interfaces 

C. primitives 

D. abstract classes 

E. concrete classes 

F. primitive wrappers 

Answer: B,D 

Explanation: 

When To Use Interfaces An interface allows somebody to start from scratch to implement your interface or implement your interface insome other code whose original or primary purpose was quite different from your interface. To them, yourinterface is only incidental, something that have to add on to thetheir code to be able to use your package. Thedisadvantage is every method in the interface must be public. You might not want to expose everything. 

*When To Use Abstract classes An abstract class, in contrast, provides more structure. It usually defines some default implementations andprovides some tools useful for a full implementation. The catch is, code using it must use your class as thebase. That may be highly inconvenient if the other programmers wanting to use your package have alreadydeveloped their own class hierarchy independently. In Java, a class can inherit from only one base class.*When to Use Both You can offer the best of both worlds, an interface and an abstract class. Implementors can ignore yourabstract class if they choose. The only drawback of doing that is calling methods via their interface name isslightly slower than calling them via their abstract class name. 

Reference:http://mindprod.com/jgloss/interfacevsabstract.html 


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