[Free] 2017(Jan) EnsurePass Braindumps Oracle 1z0-853 Dumps with VCE and PDF 201-210

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

Java Standard Edition 5 Programmer Certified Professional Exam

Question No: 201 – (Topic 3)

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. wrap the code inside the foo() method with a synchronized( this ) block

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

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

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

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

Answer: A,C

Question No: 202 DRAG DROP – (Topic 3)

Click the Task button.

Ensurepass 2017 PDF and VCE

Answer:

Ensurepass 2017 PDF and VCE

Question No: 203 – (Topic 3)

Which two classes correctly implement both the java.lang.Runnable and the java.lang.Clonable interfaces? (Choose two.)

  1. public abstract class Session implements Runnable, Clonable { public void run() { /* do something */ }

    public Object clone() { /*make a copy */ }

  2. public class Session

    implements Runnable, implements Clonable { public void run() { /* do something */ }

    public Object clone() { /* make a copy */ }

  3. public class Session extends Runnable, Clonable {

    public void run() { /* do something */ } public Object clone() { /* make a copy */ }

  4. public class Session implements Runnable, Clonable { public void run();

    public Object clone();

    }

  5. public class Session implements Runnable, Clonable {

public void run() { /* do something */ } public Object clone() { /* make a copy */ }

Answer: A,E

Question No: 204 DRAG DROP – (Topic 3)

Click the Task button.

Question No: 205 – (Topic 3)

Click the Exhibit button. What is the result?

Ensurepass 2017 PDF and VCE

  1. An exception is thrown at runtime.

  2. The code will deadlock.

  3. The code may run with output quot;0 2 4 6quot;.

  4. The code may run with output quot;0 6quot;.

  5. The code may run with no output.

  6. The code may run with output quot;2 0 6 4quot;.

Answer: C

Question No: 206 – (Topic 3)

Given:

  1. abstract class Vehicle { public int speed() { return 0; }

  2. class Car extends Vehicle { public int speed() { return 60; }

  3. class RaceCar extends Car { public int speed() { return 150; }

  1. RaceCar racer = new RaceCar();

  2. Car car = new RaceCar();

  3. Vehicle vehicle = new RaceCar();

  4. System.out.println(racer.speed() quot;, quot; car.speed()

25. quot;, quot; vehicle.speed()); What is the result?

A. 0, 0, 0

B. 150, 150, 150

  1. Compilation fails.

  2. An exception is thrown at runtime.

    E. 150, 60, 0

    Answer: B

    Question No: 207 – (Topic 3)

    Given:

    1. package test; 2.

  1. class Target {

  2. public String name = quot;helloquot;;

    5. }

    What can directly access and change the value of the variable name?

    1. any class in the test package

    2. any class

    3. only the Target class

    4. any class that extends Target

Answer: A

Question No: 208 – (Topic 3)

Given:

  1. static void test() throws Error {

  2. if (true) throw new AssertionError();

  3. System.out.print(quot;test quot;);

14. }

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

  2. try { test(); }

  3. catch (Exception ex) { System.out.print(quot;exception quot;); }

  4. System.out.print(quot;end quot;);

19. }

What is the result?

  1. exception end

  2. exception test end

  3. end

  4. A Throwable is thrown by main.

  5. Compilation fails.

  6. An Exception is thrown by main.

Answer: D

Question No: 209 – (Topic 3)

Given:

  1. public class Yippee {

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

  3. for(int x = 1; x lt; args.length; x ) {

  4. System.out.print(args[x] quot; quot;);

19. }

20. }

21. } a

nd two separate command line invocations: java Yippee

java Yippee 1 2 3 4 What is the result?

  1. An exception is thrown at runtime. 1 2 3 4

  2. No output is produced. 1 2 3

  3. No output is produced. 2 3 4

  4. No output is produced. 1 2 3 4

  5. An exception is thrown at runtime. 1 2 3

  6. An exception is thrown at runtime. 2 3 4

Answer: C

Question No: 210 – (Topic 3)

Click the Exhibit button. Given:

  1. A a = new A();

  2. System.out.println(a.doit(4, 5)); What is the result?

Ensurepass 2017 PDF and VCE

  1. Line 26 prints quot;bquot; to System.out.

  2. Line 26 prints quot;aquot; to System.out.

  3. An exception is thrown at line 26 at runtime.

  4. Compilation of class A will fail due to an error in line 6.

Answer: B

100% Ensurepass Free Download!
Download Free Demo:1z0-853 Demo PDF
100% Ensurepass Free Guaranteed!
Download 2017 EnsurePass 1z0-853 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.