Testking 1Z0-804 Questions are updated and all 1Z0-804 answers are verified by experts. Once you have completely prepared with our 1Z0-804 exam prep kits you will be ready for the real 1Z0-804 exam without a problem. We have Improved Oracle 1Z0-804 dumps study guide. PASSED 1Z0-804 First attempt! Here What I Did.


♥♥ 2017 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

Q1. Given the cache class: 

A. 101 

B. Compilation fails at line 1. 

C. Compilation fails at line 2. 

D. Compilation fails at line 3. 

Answer:

Explanation: 

Compilation failure at line:1 Incorrect number of arguments for type Cache<T>; it cannot be parameterized with arguments <>illegal start of typetype cache.Cache does not take parameters. 


Q2. Which three are true? 

A. A setAutoCommit (False) method invocation starts a transaction context. 

B. An instance of Savepoint represents a point in the current transaction context. 

C. A rollback () method invocation rolls a transaction back to the last savepoint. 

D. A rollback () method invocation releases any database locks currently held by this connection object. 

E. After calling rollback (mysavepoint), you must close the savepoint object by calling mySavepoint.close() . 

Answer: A,B,C 

Explanation: 

A:The way to allow two or more statements to be grouped into a transaction is to disable the auto-commitmode. After the auto-commit mode is disabled, no SQL statements are committed until you call the methodcommit explicitly. All statements executed after the previous call to the method commit are included in thecurrent transaction and committed together as a unit. Note:When a connection is created, it is in auto-commit mode. This means that each individual SQL statementis treated as a transaction and is automatically committed right after it is executed. (To be more precise, thedefault is for a SQL statement to be committed when it is completed, not when it is executed. A statement iscompleted when all of its result sets and update counts have been retrieved. In almost all cases, however, astatement is completed, and therefore committed, right after it is executed.) 

B:The method Connection.setSavepoint, sets a Savepoint object within the current transaction. The Connection.rollback method is overloaded to take a Savepoint argument. When a transaction is rolled back toa savepoint all changes made after that savepoint are undone. 

C: calling the method rollback terminates a transaction and returns any values that were modified to theirprevious values. If you are trying to execute one or more statements in a transaction and get a SQLException, call the method rollback to end the transaction and start the transaction all over again. 


Q3. Given: 

From what threading problem does the program suffer? 

A. deadlock 

B. livelock 

C. starvation D. race condition 

Answer:

Explanation: 

A thread often acts in response to the action of another thread. If the other thread's action is also a response tothe action of another thread, then livelock may result. As with deadlock, livelocked threads are unable to makefurther progress. 

However, the threads are not blocked -- they are simply too busy responding to each other to resume work. This is comparable to two people attempting to pass each other in a corridor: Alphonse moves to his left to let Gaston pass, while Gaston moves to his right to let Alphonse pass. Seeing that they are still blocking eachother, Alphone moves to his right, while Gaston moves to his left. They'restill blocking each other, so. 


Q4. Which two are valid initialization statements? 

A. Map<String, String> m = new SortedMap<String, String>(); 

B. Collection m = new TreeMap<Object, Object>(); 

C. HashMap<Object, Object> m = new SortedMap<Object, Object>(); 

D. SortedMap<Object, Object> m = new TreeMap<Object, Object> (); 

E. Hashtable m= new HashMap(); 

F. Map<List, ArrayList> m = new Hashtable<List, ArrayList>(); 

Answer: D,F 


Q5. What are two differences between Callable and Runnable? 

A. A Callable can return a value when executing, but a Runnable cannot. 

B. A Callable can be executed by a ExecutorService, but a Runnable cannot. 

C. A Callable can be passed to a Thread, but a Runnable cannot. 

D. A Callable can throw an Exception when executing, but a Runnable cannot. 

Answer: A,D 

Explanation: 

The Callable interface is similar to Runnable, in that both are designed for classes whose instances arepotentially executed by another thread. A Runnable, however, does not return a result and cannot throw achecked exception. 


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

Explanation: 

class Dog { 

protected String bark() 

public class Beagle extends Dog { 

private String bark() 

Cannot reduce the visibility of the inherited method from Dog 


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

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. 


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


Q9. Which class(es) safely protects the doIt () method from concurrent thread access? A. Option A 

B. Option B 

C. Option C 

D. Option D 

Answer: A,D 

Explanation: 

only A und D possible 

It should be pointed out that: 

public void blah() { 

synchronized (this) { 

// do stuff 

}} 

is semantically equivalent to: 

public synchronized void blah() { 

// do stuff 

Incorrect answer: 

B: A constructor cannot be synchronized. () Object cannot be resolved to a type 

C: in static context (static void main !) no reference to this possible 


Q10. Given two classes in separate files: 

Which two import statements can make the a.b.parent class compliable? 

A. import a.b.c.Parent; 

B. import a.b.c.Child; 

C. import a.b.c.*; 

D. import a.b.*; 

E. import a.*; 

Answer: B,C 

Explanation: 

To import a specific member into the current file, put an import statement at the beginning of thefile before any type definitions but after the package statement, if there is one.C:To import all the types contained in a particular package, use the import statement with the asterisk (*)wildcard character. 

Reference: The Java Tutorials,Using Package Members