Real of 1Z0-804 practice exam materials and tutorials for Oracle certification for IT examinee, Real Success Guaranteed with Updated 1Z0-804 pdf dumps vce Materials. 100% PASS Java SE 7 Programmer II Exam exam Today!
♥♥ 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
Q71. Given: What is the most likely result?
A. size: 4, elements: 11 22 33 44
B. size: 5, elements: 11 22 33 44
C. size: 4, elements: 11 22 33 44 77
D. size: 5, elements: 11 22 33 44 77
E. a ConcurrentModification Exception is thrown
What is the result?
A. Up Down
B. Up Up
C. Up null
D. Compilation fails
E. An exception is thrown at runtime
Answer: D Explanation:
Exception in thread "main" java.lang.ExceptionInInitializerError at garden.Garden.main Caused by: java.lang.RuntimeException: Uncompilable source code - garden.Plant is not abstract and doesnot override abstract method growthDirection() in garden.Plant
Q73. Given a language code of fr and a country code of FR, which file name represents a resource bundle file namethat is not the default?
The default file is MessageBundle.properties. The non-default file name is
Note 0:.properties is a file extension for files mainly used in Java related technologies to
store the configurableparameters of an application. They can also be used for storing
strings for Internationalization and localization;these are known as Property Resource
Bundles. Each parameter is stored as a pair of strings, one storing thename of the
parameter (called the key), and the other storing the value.Note 1:You can obtain an
instance of ResourceBundle by calling its static getBundle method.public static
ResourceBundle getBundle(java.lang.String baseName) public static ResourceBundle
getBundle(java.lang.String baseName, Locale locale) For example:
ResourceBundle rb = ResourceBundle.getBundle("MyResources", Locale.US); This will
load theResourceBundle object with the values in the corresponding properties file.1.If a
suitable properties file is not found, the ResourceBundle object will use the default
properties file, whichwill be the one whose name equals the base name and has the
properties extension. In this case, the defaultfile would be MyResources.properties. 2.If this
file is not found, a java.util.MissingResourceException will bethrown.
Note2:java.util.ResourceBundle class enables you to choose and read the properties file
specific to the user'slocale and look up the values.
A ResourceBundle object has a base name. In order for a ResourceBundle object to pick
up a properties file,the filename must be composed of the ResourceBundle base name,
followed by an underscore, followed bythe language code, and optionally followed by
another underscore and the country code.
The format for the properties file name is as follows:
For example, suppose the base name is MyResources and you define the following three
US-en DE-de CN-zh Then you would have these three properties files: MyResources_en_US.properties MyResources_de_DE.properties MyResources_zh_CN.properties
Reference:Reading Properties Files using ResourceBundle
Which two statements, inserted independently at line ***, enable the program to produce the following output:
We have 002 Blue pants that cost $24.99.
A. System.out.printf("We have %03d %s pants that cost $%3.2f.\\n",quantity, color, price);
B. System.out.printf("We have$03d$s pants that cost $$3.2f.\\n",quantity, color, price);
C. String out = String.format ("We have %03d %s pants that cost $%3.2f.\\n",quantity,
D. String out = System.out.format("We have %03d %s pants that cost $%3.2f.",quantity,
E. System.out.format("We have %s%spants that cost $%s.\\n",quantity, color, price);
Q75. Sam has designed an application. It segregates tasks that are critical and executed frequently from tasks thatare non critical and executed less frequently. He has prioritized these tasks based on their criticality andfrequency of execution. After close scrutiny, he finds that the tasks designed to be non critical are rarely gettingexecuted.
From what kind of problem is the application suffering?
A. race condition
Starvation describes a situation where a thread is unable to gain regular access to sharedresources and is unable to make progress. This happens when shared resources are made unavailable forlong periods by "greedy" threads. For example, suppose an object provides a synchronized method that oftentakes a long time to return. If one thread invokes
this method frequently, other threads that also need frequentsynchronized access to the same object will often be blocked. Reference: The Java Tutorial, Starvation and Livelock
Q76. 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.*;
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
Q77. Given: What is the result?
D. Compilation fails
E. An exception is thrown at runtime
Explanation: Section: (none)
The code compiles fine.
because only one element of list is initialized : element 
elements  and  equals null
An exception is thrown at runtime due to data type comparison mismatch:
Exception in thread "main" java.lang.ClassCastException: java.lang.String cannot be cast
public static int binarySearch(char a,
char key)Searches the specified array of chars for the specified value using the binary
search algorithm. The array mustbe sorted (as by the sort method, above) prior to making
this call. If it is not sorted, the results are undefined. Ifthe array contains multiple elements
with the specified value, there is no guarantee which one will be found.
a - the array to be searched.
key - the value to be searched for.
Indexof the search key, if it is contained in the list; otherwise, (-(insertion point) - 1). The
insertionpoint is defined as the point at which the key would be inserted into the list: the
index of the first elementgreater than the key, or list.size(), if all elements in the list are less
than the specified key. Note that thisguarantees that the return value will be >= 0 if and
only if the key is found.
Q78. What will the following class print when run?
E. None of these.
Q79. 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
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.
Q80. Given the class?
What is the result?
A. Jane Doe John Doe Joe Shmoe
B. John Doe Jane Doe Joe Shmoe
C. Joe Shmoe John Doe Jane Doe
D. Joe Shmoe Jane Doe John Doe
E. Jane Doe Joe Shmoe John Doe
F. John Doe Joe Shmoe Jane Doe
Explanation: The list will be sorted alphabetically (Lastname / Firstname). first sorted by Lastname if Lastname equals, sorted by firstname Output will be: Jane Doe John Doe Joe Shmoe