10 Tips For 1Z0-804 customers

Cause all that matters here is passing the Oracle 1Z0-804 exam. Cause all that you need is a high score of 1Z0-804 Java SE 7 Programmer II Exam exam. The only one thing you need to do is downloading Actualtests 1Z0-804 exam study guides now. We will not let you down with our money-back guarantee.

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.certleader.com/1Z0-804-dumps.html

Q31. Which two are true about Singletons? 

A. A Singleton must implement serializable. 

B. A Singleton has only the default constructor. 

C. A Singleton implements a factory method. 

D. A Singleton improves a class's cohesion. 

E. Singletons can be designed to be thread-safe. 

Answer: C,E 

Q32. Given: 

Which two statements are true about the writer class? 

A. It compiles without any changes. 

B. It compiles if the code void write (String s); is added at line***. 

C. It compiles if the code void write (); is added at line ***. 

D. It compiles if the code void write (string s) { } is added at line ***. 

E. It compiles if the code write () {}is added at line ***. 

Answer:

Explanation: 

An abstract class does not need to implement the interface methods. 

Q33. You have been asked to create a ResourceBundle file to localize an application. 

Which code example specifies valid keys menu1 and menu2 with values of File Menu and View Menu? 

A. <key name ="menu1">File Menu</key> <key name ="menu1">View Menu</key> 

B. <key> menu1</key><File Menu>File Menu </value> <key> menu1</key><File Menu>View Menu </value> 

C. menu1m File menu, menu2, view menu 

D. menu1 = File Menu menu2 = View Menu 

Answer:

Explanation: 

A properties file is a simple text file. You can create and maintain a properties file with just aboutany text editor. 

You should always create a default properties file. The name of this file begins with the base name of your ResourceBundle and ends with the .properties suffix. In the PropertiesDemo program the base name is LabelsBundle. Therefore the default properties file is called LabelsBundle.properties. The following examplefilecontains the following lines: # This is the default LabelsBundle.properties file s1 = computer s2 = disk s3 = monitor s4 = keyboard Note that in the preceding file the comment lines begin with a pound sign (#). The other lines contain key-valuepairs. The key is on the left side of the equal sign and the value is on the right. For instance, s2 is the key thatcorresponds to the value disk. The key is arbitrary. We could have called s2 something else, like msg5 ordiskID. Once defined, however, the key should not change because it is referenced in the source code. Thevalues may be changed. In fact, when your localizers create new properties files to accommodate additionallanguages, they will translate the values into various languages. 

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

Q35. When using the default file system provider with a JVM running on a DOS-based file system, which statementis true? 

A. DOS file attributes can be read as a set in a single method call. 

B. DOS file attributes can be changed as a set in a single method call. 

C. DOS file attributes can be modified for symbolic links and regular files. 

D. DOS file attributes can be modified in the same method that creates the file. 

Answer:

Explanation: 

File attributes associated with a file in a file system that supports legacy "DOS" attributes. 

Usage Example: 

Path file = … 

DosFileAttributes attrs = Files.readAttributes(file, DosFileAttributes.class); 

Note: 

The methodreadAttributes() reads a file's attributes as a bulk operation. 

Q36. Given: 

What is the result? 

A. Compilation fails. 

B. 78class java.lang.Array.IndexOutOfBoundException 

C. class MarkOutOfBoundException 

D. class java.lang.arrayIndexOutOfBoundException 

Answer:

Explanation: 

The exception MarkOutOfBoundsException is already caught by the alternative ArrayIndexOutOfBoundsException 

Q37. Given: What is the result? 

A. Both const and inner will be in the output. 

B. Only const will be in the output. 

C. Compilation fails due to an error on line A. 

D. Compilation fails due to an error on line B. 

E. An Exception is thrown at runtime. 

Answer:

Explanation: 

The code compiles fine. Note:The Runnable interface should be implemented by any class whose instances are intended to beexecuted by a thread. The class must define a method of no arguments called run. This interface is designed to provide a common protocol for objects that wish to execute code while they areactive. For example, Runnable is implemented by class Thread. Being active simply means that a thread hasbeen started and has not yet been stopped. 

In addition, Runnable provides the means for a class to be active while not subclassing Thread. Aclass that implements Runnable can run without subclassing Thread by instantiating a Thread instance andpassing itself in as the target. In most cases, the 

Runnable interface should be used if you are only planning tooverride the run() method and 

no other Thread methods. This is important because classes should not besubclassed 

unless the programmer intends on modifying or enhancing the fundamental behavior of the 

class. 

Note 2:start() 

Causes this thread to begin execution; the Java Virtual Machine calls the run method of 

this thread. 

Reference:java.lang 

Interface Runnable 

Q38. Given: 

Which two are true? 

A. Thread is printed 

B. Runnable is printed 

C. No output is produced 

D. No new threads of execution are started within the main method 

E. One new thread of execution is started within the main method 

F. Two new threads of exclusion are started within the main method 

Answer: C,D 

Q39. Given: What is the result? 

A. Three 

B. One 

C. Compilation fails. 

D. The program runs, but prints no output. 

Answer:

Explanation: 

push 

void push(E e) 

Pushes an element onto the stack represented by this deque (in other words, at the head 

of this deque) if it ispossible to do so immediately without violating capacity restrictions, 

returning true upon success and throwingan IllegalStateException if no space is currently 

available. 

This method is equivalent to addFirst(E). 

pop 

E pop() 

Pops an element from the stack represented by this deque. In other words, removes and 

returns the firstelement of this deque. 

This method is equivalent to removeFirst(). 

Returns: 

the element at the front of this deque (which is the top of the stack represented by this 

deque) 

Throws: 

NoSuchElementException – if this deque is empty 

Q40. Which four are syntactically correct? 

A. package abc; package def; import Java.util . * ; public class Test { } 

B. package abc; import Java.util.*; import Java.util.regex.* ; public class Test { } 

C. package abc; public class Test {} import Java.util.* ; 

D. import Java.util.*; package abc; public class Test {} 

E. package abc; import java.util. *; public class Test{} 

F. public class Test{} package abc; import java.util.*{} 

G. import java.util.*; public class Test{} 

H. package abc; public class test {} 

Answer: B,E,G,H 

Certleader Dumps
Certleader is a company specialized on providing high quality IT exam materials and fully committed to assist our respected clients crack any IT certification tests on their 1st efforts.