Oracle Java Standard Edition 5 Programmer Certified Professional - 1Z0-853 FREE EXAM DUMPS QUESTIONS & ANSWERS

Click the Exhibit button. Given:
34.
Test t = new Test();
35.
t.method(5);
What is the output from line 5 of the Test class?
Correct Answer: B Vote an answer
Given:
34.
HashMap props = new HashMap();
35.
props.put("key45", "some value");
36.
props.put("key12", "some other value");
37.
props.put("key39", "yet another value");
38.
Set s = props.keySet();
39.
// insert code here
What, inserted at line 39, will sort the keys in the props HashMap?
Correct Answer: A Vote an answer
Given:
11.
public static Collection get() {
12.
Collection sorted = new LinkedList();
13.
sorted.add("B"); sorted.add("C"); sorted.add("A");
14.
return sorted;
15.
}
16.
public static void main(String[] args) {
17.
for (Object obj: get()) {
18.
System.out.print(obj + ", ");
19.
}
20.
}
What is the result?
Correct Answer: C Vote an answer
Which two statements are true about the hashCode method? (Choose two.)
Correct Answer: A,E Vote an answer
Given:
12.
NumberFormat nf = NumberFormat.getInstance();
13.
nf.setMaximumFractionDigits(4);
14.
nf.setMinimumFractionDigits(2);
15.
String a = nf.format(3.1415926);
16.
String b = nf.format(2);
Which two statements are true about the result if the default locale is Locale.US? (Choose two.)
Correct Answer: C,D Vote an answer
Click the Exhibit button.
Given:
ClassA a = new ClassA();
a.methodA();
What is the result?
Correct Answer: B Vote an answer
Given:
11.
// insert code here
12.
private N min, max;
13.
public N getMin() { return min; }
14.
public N getMax() { return max; }
15.
public void add(N added) {
16.
if (min == null || added.doubleValue() < min.doubleValue()) 17. min = added;
18. if (max == null || added.doubleValue() > max.doubleValue()) 19. max = added;
20.
}
21.
}
Which two, inserted at line 11, will allow the code to compile? (Choose two.)
Correct Answer: D,E Vote an answer
Given:
1.public class Threads3 implements Runnable {
2.public void run() {
3.System.out.print("running");
4.}
5.public static void main(String[] args) {
6.Thread t = new Thread(new Threads3());
7.t.run();
8.t.run();
9.t.start();
10.
}
11.
}
What is the result?
Correct Answer: A Vote an answer
Given:
1.public class Blip {
2.protected int blipvert(int x) { return 0; }
3.}
4.class Vert extends Blip {
5.// insert code here
6.}
Which five methods, inserted independently at line 5, will compile? (Choose five.)
Correct Answer: B,C,D,E,G Vote an answer
Given:
11.
class Converter {
12.
public static void main(String[] args) {
13.
Integer i = args[0];
14.
int j = 12;
15.
System.out.println("It is " + (j==i) + " that j==i.");
16.
}
17.
}
What is the result when the programmer attempts to compile the code and run it with the command java Converter 12?
Correct Answer: A Vote an answer
Given:
11.
public static void append(List list) { list.add("0042"); }
12.
public static void main(String[] args) {
13.
List<Integer> intList = new ArrayList<Integer>();
14.
append(intList);
15.
System.out.println(intList.get(0));
16.
}
What is the result?
Correct Answer: E Vote an answer
A programmer must create a generic class MinMax and the type parameter of MinMax must implement Comparable. Which implementation of MinMax will compile?
Correct Answer: C Vote an answer
Given classes defined in two different files:
1.package util;
2.public class BitUtils {
3.public static void process(byte[]) { /* more code here */ }
4.}
1.package app;
2.public class SomeApp {
3.public static void main(String[] args) {
4.byte[] bytes = new byte[256];
5.// insert code here
6.}
7.}
What is required at line 5 in class SomeApp to use the process method of BitUtils?
Correct Answer: D Vote an answer
0
0
0
10