Given:
11. public static void test(String str) {
12. int check = 4;
13. if (check = str.length()) {
14. System.out.print(str.charAt(check -= 1) +", ");
15. } else {
16. System.out.print(str.charAt(0) + ", ");
17. }
18. } and the invocation:
21. test("four");
22. test("tee");
23. test("to");
What is the result?
A. r, t, t,Given:
1.
public class Target {
2.
private int i = 0;
3.
public int addOne(){
4.
return ++i;
5.
}
6.
} And:
1.
public class Client {
2.
public static void main(String[] args){
3.
System.out.println(new Target().addOne());
4.
}
5.
}
Which change can you make to Target without affecting Client?
A. Line 4 of class Target can be changed to return i++;Which two code fragments are most likely to cause a StackOverflowError? (Choose two.)
A. int []x = {1,2,3,4,5}; for(int y = 0; y < 6; y++) System.out.println(x[y]);Given:
10.
interface Data { public void load(); }
11.
abstract class Info { public abstract void load(); }
Which class correctly uses the Data interface and Info class?
A. public class Employee extends Info implements Data { public void load() { /*do something*/ } }Given:
11 public class Person {
12 private name;
13 public Person(String name) {
14 this.name = name;
15 }
16 public int hashCode() {
17 return 420;
18 }
19 }
Which statement is true?
A. The time to find the value from HashMap with a Person key depends on the size of the map.Given:
1.
public class Mule {
2.
public static void main(String[] args) {
3.
boolean assert = true;
4.
if(assert) {
5.
System.out.println("assert is true");
6.
}
7.
}
8.
}
Which command-line invocations will compile?
A. javac Mule.javaGiven:
11.
class A {
12.
public void process() { System.out.print("A,"); }
13.
class B extends A {
14.
public void process() throws IOException {
15.
super.process();
16.
System.out.print("B,");
17.
throw new IOException();
18.
}
19.
public static void main(String[] args) {
20.
try { new B().process(); }
21.
catch (IOException e) { System.out.println("Exception"); }
22.
}
What is the result?
A. ExceptionClick the Exhibit button. Which three statements are true? (Choose three.)

Given:
5.
class Thingy { Meter m = new Meter(); }
6.
class Component { void go() { System.out.print("c"); } }
7.
class Meter extends Component { void go() { System.out.print("m"); } } 8.
9.
class DeluxeThingy extends Thingy {
10.
public static void main(String[] args) {
11.
DeluxeThingy dt = new DeluxeThingy();
12.
dt.m.go();
13.
Thingy t = new DeluxeThingy();
14.
t.m.go();
15.
}
16.
}
Which two are true? (Choose two.)
A. The output is mm.Given:
5.
class Atom {
6.
Atom() { System.out.print("atom "); }
7.
}
8.
class Rock extends Atom {
9.
Rock(String type) { System.out.print(type); }
10.
}
11.
public class Mountain extends Rock {
12.
Mountain() {
13.
super("granite ");
14.
new Rock("granite ");
15.
}
16.
public static void main(String[] a) { new Mountain(); }
17.
}
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.