Tested Oracle 1Z0-804 Rapidshare

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

Page: 1 / 12
Total 150 questions Full Exam Access
Question 1
Given:
1Z0-804 dumps exhibit
What is the result?
My answer: -
Reference answer: A
Reference analysis:

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

Question 2
Given the code fragment: DateFormat df;
Which statement defines a new Dateformat object that displays the default date format for the UK Locale?
My answer: -
Reference answer: C
Reference analysis:

The UK locale is constructed withLocale.UK.
To format a date for a different Locale, specify it in the call to getDateInstance(). DateFormat df =
DateFormat.getDateInstance(DateFormat.LONG, Locale.FRANCE); Note: getDateInstance( int style, Locale aLocale )
Gets the date formatter with the given formatting style for the given locale. Reference:Class DateFormat

Question 3
Assuming the port statements are correct, which two (three?) code fragments create a one- byte file?
My answer: -
Reference answer: ABC
Reference analysis:

B:Create DataOutputStream from FileOutputStream public static void main(String[] args) throws
Exception { FileOutputStream fos = new FileOutputS tream("C:/demo.txt"); DataOutputStream dos = new
DataOutputStream(fos); Note:
The FileOutputStream class is a subclass of OutputStream. You can construct a FileOutputStream object by passing a string containing a path name or a File object.
You can also specify whether you want to append the output to an existing file. public FileOutputStream (String path)
public FileOutputStream (String path, boolean append) public FileOutputStream (File file)
public FileOutputStream (File file, boolean append)
With the first and third constructors, if a file by the specified name already exists, the file will be overwritten. Toappend to an existing file, pass true to the second or fourth constructor.
Note 2:public class DataOutputStreamextends FilterOutputStreamimplements DataOutput A data output stream lets an application write primitive Java data types to an output stream in a portable way.
An application can then use a data input stream to read the data back in. Reference:java.io Class DataOutputStream

Question 4
Given the fragment:
1Z0-804 dumps exhibit
If thread a and thread b are running, but not completing, which two could be occurring?
My answer: -
Reference answer: AB
Reference analysis:

A: A thread often acts in response to the action of another thread. If the other thread\'s action is also a responseto the action of another thread, then livelock may result. A thread often acts in response to the action ofanother thread. If the other thread\'s action is also a response to the action of another thread, then livelock mayresult.
B: Deadlock describes a situation where two or more threads are blocked forever, waiting for each other.

Question 5
Given:
1Z0-804 dumps exhibit
What is the result?
My answer: -
Reference answer: A
Reference analysis:

None

Question 6
A valid reason to declare a class as abstract is to:
My answer: -
Reference answer: B
Reference analysis:

Note:An abstract method in Java is something like a pure virtual function in C++ (i.e., a virtualfunction that is declared = 0). In C++, a class that contains a pure virtual function is called an abstract classand cannot be instantiated. The same is true of Java classes that contain abstract methods.
Any class with an abstract method is automatically abstract itself and must be declared as such.
An abstract class cannot be instantiated.
A subclass of an abstract class can be instantiated only if it overrides each of the abstract methods of itssuperclass and provides an implementation (i.e., a method body) for all of them. Such a class is often called aconcrete subclass, to emphasize the fact that it is not abstract.
If a subclass of an abstract class does not implement all the abstract methods it inherits, that subclass is itselfabstract.static, private, and final methods cannot be abstract, since these types of methods cannot be overridden by asubclass. Similarly, a final class cannot contain any abstract methods.
A class can be declared abstract even if it does not actually have any abstract methods. Declaring such a classabstract indicates that the implementation is somehow incomplete and is meant to serve as a superclass forone or more subclasses that will complete the implementation. Such a class cannot be instantiated.

Question 7
Which three statements are correct about thread's sleep method?
My answer: -
Reference answer: ACE
Reference analysis:

sleep (long millis) not B
Causes the currently executing thread to sleep (temporarily cease execution) for the specified number ofmilliseconds(A, not B)
millis - the length of time to sleep in milliseconds.
throws InterruptedException: - if another thread has interrupted the current thread. The interrupted status ofthe current thread is cleared when this exception is thrown. java.lang.Throwable
java.lang.Exception java.lang.InterruptedException
The thread does not lose ownership of any monitors. It means that if the thread has an object-monitor, all otherthreads that need that monitor are blocked.
This method can be called regardless whether the thread has any monitor or not.

Question 8
Which code fragment is required to load a JDBC 3.0 driver?
My answer: -
Reference answer: B
Reference analysis:

In previous versions (prior to 4.0) of JDBC, to obtain a connection, you first had to initialize your JDBCdriver by calling the method Class.forName. This methods required an object of type java.sql.Driver.
Note:
DriverManager: This fully implemented class connects an application to a data source, which is specified by adatabase URL. When this class first attempts to establish a connection, it automatically loads any JDBC 4.0drivers found within the class path. Note that your application must manually load any JDBC drivers prior toversion 4.0.

Question 9
Given:
1Z0-804 dumps exhibit
What is the result?
My answer: -
Reference answer: A
Reference analysis:

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

Question 10
Given:
1Z0-804 dumps exhibit
Which group of method is moved to a new class when implementing the DAO pattern?
My answer: -
Reference answer: D
Reference analysis:

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)
\"1Z0-804
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; }

Question 11
Given:
1Z0-804 dumps exhibit
What is the result?
My answer: -
Reference answer: D
Reference analysis:

addFirst
void addFirst(E e)
Inserts the specified element at the front of this deque if it is possible to do so immediately without violating
capacity restrictions. When using a capacity-restricted deque, it is generally preferable to use method offerFirst (E).
pollLast
E pollLast()
Retrieves and removes the last element of this deque, or returns null if this deque is empty. Returns:
the tail of this deque, or null if this deque is empty

Question 12
Given the two Java classes:
1Z0-804 dumps exhibit
Which two code snippets, added independently at line ***, can make the Buzzword class compile?
My answer: -
Reference answer: CF
Reference analysis:

None

Question 13
Given the code fragment:
1Z0-804 dumps exhibit
What is the result, if the file myfile.txt does not exist?
My answer: -
Reference answer: D
Reference analysis:

!! Compilation fails if FileNotFoundException is tried to catch (Line 12)
(The exception FileNotFoundException is already caught by the alternative IOException)
-----------------------------------------------------------------------------------------------
if this is removed will be thrown a FileNotFoundException at line 4.

Question 14
Which code example specifies valid keys menu1 and menu2 with values of File Menu and View Menu?
My answer: -
Reference answer: D
Reference analysis:

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.

Question 15
Given:
StringBuffer b = new StringBuffer("3"); System.out.print(5+4+b+2+1);
What is the result?
My answer: -
Reference answer: F
Reference analysis:

The code will not compile.
The print function cannot handle the mixture of integers and strings.
Exception in thread "main" java.lang.RuntimeException: Uncompilable source code - Erroneous tree type

Question 16
Given:
What is the result?
My answer: -
Reference answer: F
Reference analysis:

Line:Vehicle v = new Sportscar(); causes compilation failure:
error: cannot find symbol Vehicle v = new Sportscar(); symbol: class Sportscar location: class VehicleTest

Question 17
Given the fragment:
1Z0-804 dumps exhibit
Which two valid alternatives to line 3 would decouple this application from a specific implementation ofCustomerDAO?
My answer: -
Reference answer: CE
Reference analysis:

Note: In software development, the term"decoupling"is used to identify the separation of software blocks thatshouldn\'t depend on each other. Some building blocks are generic and shouldn\'t know details of others.
Special design techniques allow software designers to have as few dependencies as possible. This typicallyreduces the risk of malfunction in one part of a system when the other part changed. It also forces thedeveloper to focus on one thing at a time. Decoupling lowers or minimizes Coupling.

Question 18
Given the code fragment:
1Z0-804 dumps exhibit
If the file userguide.txt does not exist, what is the result?
My answer: -
Reference answer: E
Reference analysis:

Compilation fails : Exception Exception is not compatible with throws clause in Base.process() IOExceptiondie Exception in der Derived Class Methode muss zur Base
Class Methode passen.

Question 19
Given the classes:
1Z0-804 dumps exhibit
What is the result?
My answer: -
Reference answer: B
Reference analysis:

getName() is missing in John, hence Pupils getName() is invoked and the String in Pupils scope returned.

Question 20
Given:
1Z0-804 dumps exhibit
Which two classes correctly override the getDepth method?
My answer: -
Reference answer: AE
Reference analysis:

Note: The abstract class Number is the superclass of classes Byte, Double, Float, Integer, Long, and Short.
Subclasses of Number must provide methods to convert the represented numeric value to byte, double, float, int, long, and short.
When class C extends B, we say that C is a "subclass" of B, and B is the "superclass" of C. This is called inheritence, because C inherited from B.

Question 21
What will the following class print when run?
1Z0-804 dumps exhibit
My answer: -
Reference answer: C
Reference analysis:

None

Page: 1 / 12
Total 150 questions Full Exam Access