Top Quality of 1Z0-804 training materials and testing software for Oracle certification for customers, Real Success Guaranteed with Updated 1Z0-804 pdf dumps vce Materials. 100% PASS Java SE 7 Programmer II Exam exam Today!

2016 Jun 1Z0-804 Study Guide Questions:

Q81. Given that myFile.txt contains: 

What is the result? 

A. 1: First 

2: Second 

3:

 Third 

B. 

1: First 

2: Second 

3:

 First 

C. 

1: First 

2: First 

3:

 First 

D. 

IOExcepton 

E. 

Compilation fails 

Answer: B 

Explanation: 

BufferedReader: mark() : Marks the present position in the stream. Subsequent calls to 

reset() will attempt toreposition the stream to this point. 

reset() : Resets the stream to the most recent mark. 

!! After last Line is read (readLine()), a trial to reset() throws IOException : Mark invalid 


Q82. Which two demonstrate the valid usage of the keyword synchronized? 

A. interface ThreadSafe { 

synchronized void doIt(); 

B. abstract class ThreadSafe { 

synchronized abstract void doIt(); 

C. class ThreadSafe { 

synchronized static void soIt () {} 

D. enum ThreadSafe { 

ONE, TWO, Three; 

synchronized final void doIt () {} 

Answer: C 

Explanation: 

The Java programming language provides two basic synchronization idioms: 

synchronized methods and synchronized statements. 

To make a method synchronized, simply add the synchronized keyword to its declaration. 


Q83. 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: D 

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. 


1Z0-804  training

Most up-to-date java exam 1z0-804:

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


Q85. Given the code fragment: 

Assume that the SQL queries return records. What is the result of compiling and executing this code fragment? 

A. The program prints employee IDs 

B. The program prints customer IDs 

C. The program prints Error 

D. Compilation fails on line *** 

Answer: C 

Explanation: 

!!! The given Code prints Error -- the second query clears the ResultSet !? ErrorMessage: Operation notallowed after ResultSet closed 

It would print A, if second Query i set to rs = stmt.executeQuery("SELECT ID FROM Customer"); // Line *** It would print B, if Line *** is missing. // The program compiles and runs fine. Both executeQuery statements will run. The first executeQuery statement (ResultSet rs = stmt.executeQuery(query);) will set the rs Resultset. It will be used in the while loop. EmployIDswill be printed. Note: Executes the given SQL statement, which returns a single ResultSet object. Parameters:sql - an SQL statement to be sent to the database, typically a static SQL SELECT statement Returns:a ResultSet object that contains the data produced by the given query; never null 


Q86. What will the following class print when run? 

A. javajava 

B. lavajava 

C. javajavac 

D. lavajavac 

E. None of these. 

Answer: C 


2passeasy.com

Pinpoint oracle 1z0-804:

Q87. Given the code fragment: SimpleDataFormat sdf; 

Which code fragment displays the three-character month abbreviation? 

A. SimpleDateFormat sdf = new SimpleDateFormat ("mm", Locale.UK); System.out.println 

("Result:" + 

sdf.format(new Date())); 

B. SimpleDateFormat sdf = new SimpleDateFormat ("MM", Locale.UK); System.out.println 

("Result:" + 

sdf.format(new Date())); 

C. SimpleDateFormat sdf = new SimpleDateFormat ("MMM", Locale.UK); 

System.out.println ("Result:" + 

sdf.format(new Date())); 

D. SimpleDateFormat sdf = new SimpleDateFormat ("MMMM", Locale.UK); 

System.out.println ("Result:" + 

sdf.format(new Date())); 

Answer: C 


Q88. A valid reason to declare a class as abstract is to: 

A. define methods within a parent class, which may not be overridden in a child class 

B. define common method signatures in a class, while forcing child classes to contain unique methodimplementations 

C. prevent instance variables from being accessed 

D. prevent a class from being extended 

E. define a class that prevents variable state from being stored when object Instances are serialized 

F. define a class with methods that cannot be concurrently called by multiple threads 

Answer: B 

Explanation: 

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. 


Q89. Given: 

What is the result? 

A. Event Quiz 

B. Event Event 

C. Quiz Quiz 

D. Quiz Event 

E. Compilation fails 

Answer: E 


Q90. Given the code fragment: 

Which three are true? 

A. On line 3, the current thread stops and waits until the t1 thread finishes. 

B. On line 3, the t1 thread stops and waits until the current thread finishes. 

C. On line 4, the t1 thread is dead. 

D. On line 4, the t1 thread is waiting to run. 

E. This code cannot throw a checked exception. 

F. This code may throw a checked exception. 

Answer: A,C,F 

Explanation: 

Thejoin()methods waits for this thread to die.