Given:
1.
d is a valid, non-null Date object
2.
df is a valid, non-null DateFormat object set to the current locale
What outputs the current locale's country name and the appropriate version of d's date?
A. Locale loc = Locale.getLocale(); System.out.println(loc.getDisplayCountry() + " " + df.format(d));Given:
10.
public class Foo {
11.
static int[] a;
12.
static { a[0]=2; }
13.
public static void main( String[] args ) {}
14.
}
Which exception or error will be thrown when a programmer attempts to run this code?
A. java.lang.StackOverflowErrorClick the Exhibit button. Given: ClassA a = new ClassA(); a.methodA(); What is the result?

Given:
1.
public class Boxer1{
2.
Integer i;
3.
int x;
4.
public Boxer1(int y) {
5.
x = i+y;
6.
System.out.println(x);
7.
}
8.
public static void main(String[] args) {
9.
new Boxer1(new Integer(4));
10.
}
11.
}
What is the result?
A. The value "4" is printed at the command line.Given:
2.
public class Hi {
3.
void m1() { }
4.
protected void() m2 { }
5.
}
6.
class Lois extends Hi {
7.
// insert code here
8.
}
Which four code fragments, inserted independently at line 7, will compile? (Choose four.)
A. public void m1() { }Given:
11.
public class Person {
12.
private String name;
13.
public Person(String name) {
14.
this.name = name;
15.
}
16.
public boolean equals(Object o) {
17.
if ( ! ( o instanceof Person) ) return false;
18.
Person p = (Person) o;
19.
return p.name.equals(this.name);
20.
}
21.
}
Which statement is true?
A. Compilation fails because the hashCode method is not overridden.Given:
11.
public class Test {
12.
public enum Dogs {collie, harrier, shepherd};
13.
public static void main(String [] args) {
14.
Dogs myDog = Dogs.shepherd;
15.
switch (myDog) {
16.
case collie:
17.
System.out.print("collie ");
18.
case default:
19.
System.out.print("retriever ");
20.
case harrier:
21.
System.out.print("harrier ");
22.
}
23.
}
24.
}
What is the result?
A. harrierGiven:
11.
public static Iterator reverse(List list) {
12.
Collections.reverse(list);
13.
return list.iterator();
14.
}
15.
public static void main(String[] args) {
16.
List list = new ArrayList();
17.
list.add("1"); list.add("2"); list.add("3");
18.
for (Object obj: reverse(list))
19.
System.out.print(obj + ", ");
20.
}
What is the result?
A. 3, 2, 1,Given:
11.
static void test() throws RuntimeException {
12.
try {
13.
System.out.print("test ");
14.
throw new RuntimeException();
15.
}
16.
catch (Exception ex) { System.out.print("exception "); }
17.
}
18.
public static void main(String[] args) {
19.
try { test(); }
20.
catch (RuntimeException ex) { System.out.print("runtime "); }
21.
System.out.print("end ");
22.
}
What is the result?
A. test endGiven:
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.)
A. The value of b is 2.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.