[Free] 2017(Jan) EnsurePass Braindumps Oracle 1z0-851 Dumps with VCE and PDF 51-60

Ensurepass.com : Ensure you pass the IT Exams
2017 Jan Oracle Official New Released 1z0-851
100% Free Download! 100% Pass Guaranteed!
http://www.EnsurePass.com/1z0-851.html

Java Standard Edition 6 Programmer Certified Professional Exam

Question No: 51 – (Topic 1)

Given:

  1. static class A {

  2. void process() throws Exception { throw new Exception(); }

13. }

  1. static class B extends A {

  2. void process() { System.out.println(quot;Bquot;); }

16. }

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

  2. new B().process();

19. }

What is the result?

  1. B

  2. The code runs with no output.

  3. Compilation fails because of an error in line 12.

  4. Compilation fails because of an error in line 15.

  5. Compilation fails because of an error in line 18.

    Answer: A

    Question No: 52 – (Topic 1)

    Given:

    1. public class Threads5 {

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

    3. new Thread(new Runnable() {

    4. public void run() {

    5. System.out.print(quot;barquot;); 6. }}).start();

      7. }

      8. }

      What is the result?

      1. Compilation fails.

      2. An exception is thrown at runtime.

      3. The code executes normally and prints quot;barquot;.

      4. The code executes normally, but nothing prints.

        Answer: C

        Question No: 53 – (Topic 1)

        Given:

        1. public class TestOne implements Runnable {

        2. public static void main (String[] args) throws Exception {

        3. Thread t = new Thread(new TestOne());

        4. t.start();

        5. System.out.print(quot;Startedquot;);

        6. t.join();

        7. System.out.print(quot;Completequot;); 8. }

9. public void run() {

10. for (int i = 0; i lt; 4; i ) {

11. System.out.print(i);

12. }

13. }

14. }

What can be a result?

  1. Compilation fails.

  2. An exception is thrown at runtime.

  3. The code executes and prints quot;StartedCompletequot;.

  4. The code executes and prints quot;StartedComplete0123quot;.

  5. The code executes and prints quot;Started0123Completequot;.

Answer: E

Question No: 54 – (Topic 1)

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

Ensurepass 2017 PDF and VCE

  1. 4

  2. 5

  3. 8

  4. 9

  5. Compilation fails.

  6. An exception is thrown at runtime.

  7. It is impossible to determine for certain.

    Answer: D

    Question No: 55 – (Topic 1)

    Given:

    1. public class TestFive {

    2. private int x;

    3. public void foo() {

    4. int current = x;

    5. x = current 1; 6. }

7. public void go() {

8. for(int i = 0; i lt; 5; i ) {

  1. new Thread() {

  2. public void run() {

  3. foo();

  4. System.out.print(x quot;, quot;);

13. } }.start(); 14. } }

Which two changes, taken together, would guarantee the output: 1, 2, 3, 4, 5, ? (Choose two.)

  1. move the line 12 print statement into the foo() method

  2. change line 7 to public synchronized void go() {

  3. change the variable declaration on line 2 to private volatile int x;

  4. wrap the code inside the foo() method with a synchronized( this ) block

  5. wrap the for loop code inside the go() method with a synchronized block synchronized(this) { // for loop code here }

    Answer: A,D

    Question No: 56 – (Topic 1)

    Given:

    1. public class Threads2 implements Runnable { 2.

  1. public void run() {

  2. System.out.println(quot;run.quot;);

  3. throw new RuntimeException(quot;Problemquot;); 6. }

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

  2. Thread t = new Thread(new Threads2());

  3. t.start();

  4. System.out.println(quot;End of method.quot;);

11. }

12. }

Which two can be results? (Choose two.)

  1. java.lang.RuntimeException: Problem

  2. run.

    java.lang.RuntimeException: Problem

  3. End of method. java.lang.RuntimeException: Problem

  4. End of method. run.

    java.lang.RuntimeException: Problem

  5. run.

    java.lang.RuntimeException: Problem End of method.

    Answer: D,E

    Question No: 57 DRAG DROP – (Topic 1)

    Click the Task button.

    Ensurepass 2017 PDF and VCE

    Answer:

    Ensurepass 2017 PDF and VCE

    Question No: 58 DRAG DROP – (Topic 1)

    Click the Task button.

    Ensurepass 2017 PDF and VCE

    Answer:

    Ensurepass 2017 PDF and VCE

    Question No: 59 DRAG DROP – (Topic 1)

    Click the Task button.

    Ensurepass 2017 PDF and VCE

    Answer:

    Ensurepass 2017 PDF and VCE

    Question No: 60 DRAG DROP – (Topic 1)

    Click the Task button.

    Ensurepass 2017 PDF and VCE

    Answer:

    Ensurepass 2017 PDF and VCE

    100% Ensurepass Free Download!
    Download Free Demo:1z0-851 Demo PDF
    100% Ensurepass Free Guaranteed!
    Download 2017 EnsurePass 1z0-851 Dumps

    EnsurePass ExamCollection Testking
    Lowest Price Guarantee Yes No No
    Up-to-Dated Yes No No
    Real Questions Yes No No
    Explanation Yes No No
    PDF VCE Yes No No
    Free VCE Simulator Yes No No
    Instant Download Yes No No

    2017 EnsurePass IT Certification PDF and VCE

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.