Ensurepass.com : Ensure you pass the IT Exams
2018 Jan Oracle Official New Released 1z0-854
100% Free Download! 100% Pass Guaranteed!
http://www.EnsurePass.com/1z0-854.html
Java Standard Edition 5 Programmer Certified Professional Upgrade Exam
Question No: 1
Given:
20. public class CreditCard { 21.
-
private String cardID;
-
private Integer limit;
-
public String ownerName; 25.
-
public void setCardInformation(String cardID,
-
String ownerName,
-
Integer limit) {
-
this.cardID = cardID;
-
this.ownerName = ownerName;
-
this.limit = limit;
32. }
33. }
Which statement is true?
-
The ownerName variable breaks encapsulation.
-
The class is fully encapsulated.
-
The cardID and limit variables break polymorphism.
-
The code demonstrates polymorphism.
-
The setCardInformation method breaks encapsulation.
Answer: A
Question No: 2 DRAG DROP
Click the Task button.
Answer:
Question No: 3 DRAG DROP
Click the Task button.
Answer:
Question No: 4
Which three statements concerning the use of the java.io.Serializable interface are true?
(Choose three.)
-
Objects from classes that use aggregation cannot be serialized.
-
The values in fields with the transient modifier will NOT survive serialization and deserialization.
-
It is legal to serialize an object of a type that has a supertype that does NOT implement java.io.Serializable.
-
The values in fields with the volatile modifier will NOT survive serialization and deserialization.
-
An object serialized on one JVM can be successfully deserialized on a different JVM.
Answer: B,C,E
Question No: 5
Which two code fragments will execute the method doStuff() in a separate thread? (Choose two.)
-
new Thread() {
public void start() { doStuff(); }
};
-
new Thread() {
public void run() { doStuff(); }
};
-
new Thread(new Runnable() { public void run() { doStuff(); }
}).start();
-
new Thread() {
public void start() { doStuff(); }
}.run();
-
new Thread(new Runnable() { public void run() { doStuff(); }
}).run();
-
new Thread() {
public void run() { doStuff(); }
}.start();
Answer: C,F
Question No: 6
Given:
-
import java.io.*;
-
public class Forest implements Serializable {
-
private Tree tree = new Tree();
-
public static void main(String [] args) {
-
Forest f = new Forest();
-
try {
-
FileOutputStream fs = new FileOutputStream(quot;Forest.serquot;);
-
ObjectOutputStream os = new ObjectOutputStream(fs);
-
os.writeObject(f); os.close();
-
} catch (Exception ex) { ex.printStackTrace(); } 22. } }
23.
24. class Tree { } What is the result?
-
An exception is thrown at runtime.
-
An instance of Forest is serialized.
-
An instance of Forest and an instance of Tree are both serialized.
-
Compilation fails.
Answer: A
Question No: 7
Given:
-
interface TestA { String toString(); }
-
public class Test {
-
public static void main(String[] args) {
-
System.out.println(new TestA() {
-
public String toString() { return quot;testquot;; } 6. });
7. }
8. }
What is the result?
-
null
-
An exception is thrown at runtime.
-
Compilation fails because of an error in line 5.
-
Compilation fails because of an error in line 4.
-
Compilation fails because of an error in line 1.
-
test
Answer: F
Question No: 8 DRAG DROP
Click the Task button.
Answer:
Question No: 9
Given:
-
public class Boxer1{
-
Integer i;
-
int x;
-
public Boxer1(int y) {
-
x = i y;
-
System.out.println(x); 7. }
-
-
-
-
public static void main(String[] args) {
-
new Boxer1(new Integer(4));
10. }
11. }
What is the result?
-
Compilation fails because of an error in line 5.
-
A NullPointerException occurs at runtime.
-
Compilation fails because of an error in line 9.
-
A NumberFormatException occurs at runtime.
-
The value quot;4quot; is printed at the command line.
-
An IllegalStateException occurs at runtime.
Answer: B
Question No: 10
Given:
10: public class Hello { 11: String title;
12: int value;
13: public Hello() { 14: title = quot; Worldquot;; 15: }
16: public Hello(int value) { 17: this.value = value;
18: title = quot;Helloquot;; 19: Hello();
20: }
21: }
and:
30: Hello c = new Hello(5); 31: System.out.println(c.title);
What is the result?
-
The code runs with no output.
-
Hello
-
Hello World 5
-
Compilation fails.
-
An exception is thrown at runtime.
-
Hello World
Answer: D
100% Ensurepass Free Download!
–Download Free Demo:1z0-854 Demo PDF
100% Ensurepass Free Guaranteed!
–1z0-854 DumpsEnsurePass ExamCollection Testking Lowest Price Guarantee Yes No No Up-to-Dated Yes No No Real Questions Yes No No Explanation Yes No No PDF VCE Yes No No Free VCE Simulator Yes No No Instant Download Yes No No HOT CATEGORY!HOT EXAM!100-105 Dumps VCE PDF
200-105 Dumps VCE PDF
300-101 Dumps VCE PDF
300-115 Dumps VCE PDF
300-135 Dumps VCE PDF
300-320 Dumps VCE PDF
400-101 Dumps VCE PDF
640-911 Dumps VCE PDF
640-916 Dumps VCE PDF
70-410 Dumps VCE PDF
70-411 Dumps VCE PDF
70-412 Dumps VCE PDF
70-413 Dumps VCE PDF
70-414 Dumps VCE PDF
70-417 Dumps VCE PDF
70-461 Dumps VCE PDF
70-462 Dumps VCE PDF
70-463 Dumps VCE PDF
70-464 Dumps VCE PDF
70-465 Dumps VCE PDF
70-480 Dumps VCE PDF
70-483 Dumps VCE PDF
70-486 Dumps VCE PDF
70-487 Dumps VCE PDF
220-901 Dumps VCE PDF
220-902 Dumps VCE PDF
N10-006 Dumps VCE PDF
SY0-401 Dumps VCE PDF -
-