[Breathing] 1Z0-804 Oracle free practice questions 61-70 (Dec 2021)

Downloadable of 1Z0-804 exam cost materials and questions for Oracle certification for candidates, Real Success Guaranteed with Updated 1Z0-804 pdf dumps vce Materials. 100% PASS Java SE 7 Programmer II Exam exam Today!


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

Q61. Which concept allows generic collections to interoperate with java code that defines collections that use rawtypes? 

A. bytecode manipulation 

B. casting 

C. autoboxing 

D. auto-unboxing 

E. type erasure 

Answer:

Explanation: 

The type erasure of its leftmost bound, or type Object if no bound was specified. Examples: type parameters type erasure List<String> List Map.Entry<String,Long> Map.Entry <T extends Cloneable & Comparable<T>> Cloneable <T extends Object & Comparable<T>> Object 

<T> T[] toArray(T[] a) Object[] toArray(Object[] a) 

The type erasure process can be imagined as a translation from generic Java source code 

back into regularJava code. In reality the compiler is more efficient and translates directly to 

Java byte code. But the byte codecreated is equivalent to the non-generic Java code. 


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


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


Q64. Given three resources bundles with these values set for menu1: (the default resource bundle in US English.) 

English US Resource Bundle Menu1 = small French Resource Bundle Menu1 = petit Chinese Resource Bundle Menu1 = And given the code fragment: Locale.setDefault(new Locale("es", "ES")); // Set default to Spanish and Spain 

Locale loc1 = Locale.getDefault(); 

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

System.out.println(message.getString("menu1")); 

What is the result? 

A. No message is printed 

B. petit 

C. small 

D. A runtime error is produced 

Answer:

Explanation: Compiles fine, but runtime error when trying to access the Spanish Resource bundle (which doesnot exist): Exception in thread "main" java.util.MissingResourceException: Can't find bundle for base name messageBundle, locale es_ES 


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


Q66. Which two codes correctly represent a standard language locale code? 

A. ES 

B. FR 

C. U8 

D. Es 

E. fr 

F. u8 

Answer: A,B 

Explanation: 

Language codes are defined by ISO 639, an international standard that assigns two- and three-letter codes tomost languages of the world. Locale uses the two-letter codes to identify the target language. 


Q67. Given: What is the result? 

A. p001 Widget p002 X-Large Widget 

B. p002 Large Widget p001 Widget 

C. p002 X-large Widget p001 Widget 

D. p001 Widget p002 Large Widget 

E. compilation fails 

Answer:

Explanation: Compiles fine. Output is: P001 Widget P002 X-Large Widget Line: partList.put("P002", "X-Large Widget"); >> overwrites >> line:partList.put("P002", "Large Widget"); put V put(K key, V value) Associates the specified value with the specified key in this map (optional operation). If the map previouslycontained a mapping for the key, the old value is replaced by the specified value. (Amap m is said to contain amapping for a key k if and only if m.containsKey(k) would return true.) 

Parameters: key - key with which the specified value is to be associated value - value to be associated with the specified key Returnsthe previous value associated with key, or null if there was no mapping for key. (A null return can alsoindicate that the map previously associated null with key, if the implementation supports null values.) 


Q68. Given: Which two statements concerning the OO concepts "IS-A" and "HAS-A" are true? 

A. Flimmer is-a Glommer. 

B. Flommer has-a String. 

C. Tagget has-a Glommer. 

D. Flimmer is-a ArrayList. 

E. Tagget has-a doStuff() 

F. Tagget is-a Glommer. 

Answer: B,F 

Explanation: 

B: The relationship modeled by composition is often referred to as the "has-a" relationship. 

Here Flommer hasaString. 

E: The has-a relationship has an encapsulation feature (like private or protected modifier 

used before eachmember field or method). 

Here Tagget has-a method doStuff() 

F: Tagget implements Glommer. 

Tagget is-a Glommer. 

Note: The has-a relationship has an encapsulation feature (like private or protected 

modifier used before eachmember field or method). 


Q69. Given: What is the result? 

A. 1 1 1 1 1 

B. 1 2 3 4 5 

C. 0 1 2 3 4 

D. 0 1 4 3 4 

Answer:

Explanation: 

first for-loop set 0 0 0 0 0 second for-loop increments each to 1 1 1 1 1 if condition is not given 


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