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?
A. It is true that j==i.Click the Exhibit button. What is the output if the main() method is run?

Which two code fragments correctly create and initialize a static array of int elements? (Choose two.)
A. static final int[] a = { 100,200 };Given:
12.
import java.util.*;
13.
public class Explorer3 {
14.
public static void main(String[] args) {
15.
TreeSet
16.
TreeSet
17.
for(int i = 606; i < 613; i++)
18.
if(i%2 == 0) s.add(i);
19.
subs = (TreeSet)s.subSet(608, true, 611, true);
20.
subs.add(629);
21.
System.out.println(s + " " + subs);
22.
}
23.
}
What is the result?
A. Compilation fails.A company has a business application that provides its users with many different reports:
receivables reports, payables reports, revenue projects, and so on. The company has just purchased some new, state-of-the-art, wireless printers, and a programmer has been assigned the task of enhancing all of the reports to use not only
the company's old printers, but the new wireless printers as well. When the programmer starts looking into the application, the programmer discovers that because of the design of the application, it is necessary to make changes to each
report to support the new printers.
Which two design concepts most likely explain this situation? (Choose two.)
A. InheritanceGiven:
1.
import java.util.*;
2.
public class WrappedString {
3.
private String s;
4.
public WrappedString(String s) { this.s = s; }
5.
public static void main(String[] args) {
6.
HashSet
7.
WrappedString ws1 = new WrappedString("aardvark");
8.
WrappedString ws2 = new WrappedString("aardvark");
9.
String s1 = new String("aardvark");
10.
String s2 = new String("aardvark");
11.
hs.add(ws1); hs.add(ws2); hs.add(s1); hs.add(s2);
12.
System.out.println(hs.size()); } }
What is the result?
B. 1Given:
10.
class Line {
11.
public static class Point {}
12.
}
13.
14.
class Triangle {
15.
// insert code here
16.
}
Which code, inserted at line 15, creates an instance of the Point class defined in Line?
A. Point p = new Point();Given: public class NamedCounter {
private final String name;
private int count;
public NamedCounter(String name) { this.name = name; } public String getName() { return name; } public void increment() { count++; } public int getCount() { return count; } public void reset() { count = 0; } }
Which three changes should be made to adapt this class to be used safely by multiple threads? (Choose three.)
A. declare reset() using the synchronized keywordGiven:
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.)
A. public class MinMax {Given:
1.
public class TestOne {
2.
public static void main (String[] args) throws Exception {
3.
Thread.sleep(3000);
4.
System.out.println("sleep");
5.
}
6.
}
What is the result?
A. Compilation fails.Nowadays, the certification exams become more and more important and required by more and more enterprises when applying for a job. But how to prepare for the exam effectively? How to prepare for the exam in a short time with less efforts? How to get a ideal result and how to find the most reliable resources? Here on Vcedump.com, you will find all the answers. Vcedump.com provide not only Oracle exam questions, answers and explanations but also complete assistance on your exam preparation and certification application. If you are confused on your 1Z0-851 exam preparations and Oracle certification application, do not hesitate to visit our Vcedump.com to find your solutions here.