May 2016 updated: 1z0-804 prerequisite

1Z0-804 Royal Pack Testengine pdf

100% Actual & Verified — 100% PASS

Unlimited access to the world's largest Dumps library!

https://www.2passeasy.com/dumps/1Z0-804/

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

2016 May 1Z0-804 Study Guide Questions:

Q91. Given: 

Which three are true? 

A. BasicCar uses composition. 

B. SuperCar uses composition. 

C. BasicCar is-a Car. 

D. SuperCar is-a Car. 

E. SuperCar takes advantage of polymorphism 

F. BasicCar has-a Car 

Answer: B,C,E 

Explanation: 

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

C:The relationship modeled by inheritance is often referred to as the "is-a" relationship. Modeling an is-arelationship is called inheritance because the subclass inherits the interface and, by default, theimplementation of the superclass. Inheritance of interface guarantees that a subclass can accept all the samemessages as its superclass. A subclass object can, in fact, be used anywhere a superclass object is called for.E:The polymorphic method call allows one type to express its distinction from another, similar type, as long asthey're both derived from the same base type. This distinction is expressed through differences in behavior ofthe methods that you can call through the base class. 


Q92. Select four examples that initialize a NumberFormat reference using a factory. 

A. NumberFormat nf1 = new DecimalFormat(); 

B. NumberFormat nf2 = new DecimalFormat("0.00") ; C. NumberFormat nf3 = NumberFormat.getInstance(); 

D. NumberFormat nf4 = NumberFormat.getIntegerInstance(); 

E. NumberFormat nf5 = DecimalFormat.getNumberInstance (); 

F. NumberFormat nf6 = NumberFormat.getCurrencyInstance () ; 

Answer: C,D,E,F 

Explanation: 

getInstance 

public static finalNumberFormatgetInstance() 

Returns the default number format for the current default locale. The default format is one 

of the styles 

provided by the other factory methods: getNumberInstance(E), getIntegerInstance(D), 

getCurrencyInstance(F) 

or getPercentInstance. Exactly which one is locale dependant. 

C: To obtain a NumberFormat for a specific locale, including the default locale, call one of NumberFormat'sfactory methods, such as getInstance(). E:To obtain standard formats for a given locale, use the factory methods on NumberFormat such asgetNumberInstance. These factories will return the most appropriate sub-class of NumberFormat for a givenlocale. F:To obtain standard formats for a given locale, use the factory methods on NumberFormat such asgetInstance or getCurrencyInstance. 

Reference:java.textClass NumberFormat 


Q93. Which statement declares a generic class? 

A. public class Example < T > { } 

B. public class <Example> { } 

C. public class Example <> { } 

D. public class Example (Generic) { } 

E. public class Example (G) { } 

F. public class Example { } 

Answer: A 

Explanation: 

Example: 

public class Pocket<T> 

private T value; 

public Pocket() {} 

public Pocket( T value ) { this.value = value; } 

public void set( T value ) { this.value = value; } 

public T get() { return value; } 

public boolean isEmpty() { return value != null; } 

public void empty() { value = null; } 


1Z0-804  vce

Renew java certification 1z0-804:

Q94. Given: Which three values will appear in the output? 

A. 5 

B. 7 

C. a1 

D. a2 

E. b1 

F. b2 

Answer: A,D,E 

Explanation: 

Staticmethod of base class is invoked >> 

A myA = new B(); 

System.out.print(myA.doA() + myA.doA2() + myA.a); 

class B String doA() { return "b1 "; } 

class A protected static String doA2 () { return "a2 "; } 

class B int a = 7; 


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


Q96. Given: 

What is the result? 

A. Nice to see you,be fine 

B. Nice,see you,be fine 

C. Nice,see you, to, be fine 

D. Nice, see you, be fine 

E. Nice to see y, u, be fine 

Answer: A 

Explanation: 

The text ",to," is replaced by the "," 


2passeasy.com

Refined 1z0-804 and 1z0-805:

Q97. Given: What is the result? 

A. Null 

B. class java.lang.ArraylndexOutOfBoundsException 

C. class java.lang.NullPointerException 

D. class java.lang.Exception 

E. Compilation fails. 

Answer: E 

Explanation: 

error: incompatible types e = new Exception(); required: RuntimeException found: Exception 


Q98. Given the code fragment: 

DateFormat df; 

Which statement defines a new Dateformat object that displays the default date format for the UK Locale? 

A. df = DateFormat.getDateInstance (DateFormat.DEFAULT, Locale (UK)); 

B. df = DateFormat.getDateInstance (DateFormat.DEFAULT, UK); 

C. df = DateFormat.getDateInstance (DateFormat.DEFAULT, Locale.UK); 

D. df = new DateFormat.getDateInstance (DateFormat.DEFAULT, Locale.UK); 

E. df = new DateFormat.getDateInstance (DateFormat.DEFAULT, Locale (UK)); 

Answer: C 

Explanation: 

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 


Q99. Give: What is the likely result? 

A. The program produces the correct result, with similar performance to the original. 

B. The program produces the correct result, with performance degraded to the equivalent of being singlethreaded. 

C. The program produces an incorrect result. 

D. The program goes into an infinite loop. 

E. An exception is thrown at runtime. 

F. The program produces the correct result, with better performance than the original. 

Answer: D 

Explanation: 

join() does not proceed until the task's result has been computed. Here we start to wait beforedoing the computing. The code will not finish. 


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

B. starvation 

C. deadlock 

D. livelock 

Answer: C 

Explanation: 

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 



see more Java SE 7 Programmer II Exam