Proper study guides for Renew Oracle Java Standard Edition 6 Programmer Certified Professional Exam certified begins with Oracle 1Z0-851 preparation products which designed to deliver the Vivid 1Z0-851 questions by making you pass the 1Z0-851 test at your first time. Try the free 1Z0-851 demo right now.


♥♥ 2021 NEW RECOMMEND ♥♥

Free VCE & PDF File for Oracle 1Z0-851 Real Exam (Full Version!)

★ Pass on Your First TRY ★ 100% Money Back Guarantee ★ Realistic Practice Exam Questions

Free Instant Download NEW 1Z0-851 Exam Dumps (PDF & VCE):
Available on: http://www.surepassexam.com/1Z0-851-exam-dumps.html

Q21. Given:

11. class Alpha {

12. public void foo() { System.out.print("Afoo "); }

13. }

14. public class Beta extends Alpha {

15. public void foo() { System.out.print("Bfoo "); }

16. public static void main(String[] args) {

17. Alpha a = new Beta();

18. Beta b = (Beta)a;

19. a.foo();

20. b.foo();

21. }

22. }

What is the result?

A. Afoo Afoo

B. Afoo Bfoo

C. Bfoo Afoo

D. Bfoo Bfoo

E. Compilation fails.

F. An exception is thrown at runtime.

Answer: D


Q22. DRAG DROP

Answer:


Q23. Given:

5. class A {

6. void foo() throws Exception { throw new Exception(); }

7. }

8. class SubB2 extends A {

9. void foo() { System.out.println("B "); }

10. }

11. class Tester {

12. public static void main(String[] args) {

13. A a = new SubB2();

14. a.foo();

15. }

16. }

What is the result?

A. B

B. B, followed by an Exception.

C. Compilation fails due to an error on line 9.

D. Compilation fails due to an error on line 14.

E. An Exception is thrown with no other output.

Answer: D


Q24. DRAG DROP

Click the Task button.

Answer:


Q25. Given classes defined in two different files:

1. package util;

2. public class BitUtils {

3. private static void process(byte[] b) {}

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?

A. process(bytes);

B. BitUtils.process(bytes);

C. app.BitUtils.process(bytes);

D. util.BitUtils.process(bytes);

E. import util.BitUtils.*; process(bytes);

F. SomeApp cannot use the process method in BitUtils.

Answer: F


Q26. Given:

11. interface DeclareStuff {

12. public static final int EASY = 3;

13. void doStuff(int t); }

14. public class TestDeclare implements DeclareStuff {

15. public static void main(String [] args) {

16. int x = 5;

17. new TestDeclare().doStuff(++x);

18. }

19. void doStuff(int s) {

20. s += EASY + ++s;

21. System.out.println("s " + s);

22. }

23. }

What is the result?

A. s 14

B. s 16

C. s 10

D. Compilation fails.

E. An exception is thrown at runtime.

Answer: D


Q27. 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 end

B. Compilation fails.

C. test runtime end

D. test exception end

E. A Throwable is thrown by main at runtime.

Answer: D


Q28. Given:

10. public class SuperCalc {

11. protected static int multiply(int a, int b) { return a * b;}

12. }

and:

20. public class SubCalc extends SuperCalc{

21. public static int multiply(int a, int b) {

22. int c = super.multiply(a, b);

23. return c;

24. }

25. }

and:

30. SubCalc sc = new SubCalc ();

31. System.out.println(sc.multiply(3,4));

32. System.out.println(SubCalc.multiply(2,2));

What is the result?

A. 12

B. The code runs with no output.

C. An exception is thrown at runtime.

D. Compilation fails because of an error in line 21.

E. Compilation fails because of an error in line 22.

F. Compilation fails because of an error in line 31.

Answer: E


Q29. Click the Exhibit button. What is the output if the main() method is run?

A. 4

B. 5

C. 8

D. 9

E. Compilation fails.

F. An exception is thrown at runtime.

G. It is impossible to determine for certain.

Answer: D


Q30. 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.

B. An exception is thrown at runtime.

C. The code executes normally and prints "sleep".

D. The code executes normally, but nothing is printed.

Answer: C