[Free] 2018(Jan) EnsurePass Testking Oracle 1z0-854 Dumps with VCE and PDF 41-50

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

Java Standard Edition 5 Programmer Certified Professional Upgrade Exam

Question No: 41 DRAG DROP

Click the Task button.

Ensurepass 2018 PDF and VCE

Answer:

Ensurepass 2018 PDF and VCE

Question No: 42

Given:

  1. public class Test {

  2. public enum Dogs {collie, harrier};

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

  4. Dogs myDog = Dogs.collie;

  5. switch (myDog) {

  6. case collie:

  7. System.out.print(quot;collie quot;);

  8. case harrier:

  9. System.out.print(quot;harrier quot;);

21. }

22. }

23. }

What is the result?

  1. An exception is thrown at runtime.

  2. Compilation fails.

  3. harrier

  4. collie harrier

  5. collie

    Answer: D

    Question No: 43

    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. only the Target class

    2. any class that extends Target

    3. any class

    4. any class in the test package

Answer: D

Question No: 44

Given:

11. Float pi = new Float(3.14f);

12. if (pi gt; 3) {

13. System.out.print(quot;pi is bigger than 3. quot;);

14. }

  1. else {

  2. System.out.print(quot;pi is not bigger than 3. quot;);

17. }

  1. finally {

  2. System.out.println(quot;Have a nice day.quot;);

20. }

What is the result?

  1. pi is bigger than 3. Have a nice day.

  2. Compilation fails.

  3. An exception occurs at runtime.

  4. pi is not bigger than 3. Have a nice day.

  5. pi is bigger than 3.

    Answer: B

    Question No: 45

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

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

  2. new Boxer1(new Integer(4));

    10. }

    11. }

    What is the result?

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

    2. The value quot;4quot; is printed at the command line.

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

    4. An IllegalStateException occurs at runtime.

    5. A NullPointerException occurs at runtime.

    6. A NumberFormatException occurs at runtime.

Answer: E

Question No: 46

Given:

  1. int x = 10;

  2. do { 37. x-;

38. } while (x lt; 10);

How many times will line 37 be executed?

  1. more than ten times

  2. zero times

  3. one to nine times

  4. ten times

Answer: A

Question No: 47

Click the Exhibit button.

What is the output if the main() method is run?

Ensurepass 2018 PDF and VCE

  1. An exception is thrown at runtime.

  2. 4

  3. It is impossible to determine for certain.

  4. 5

  5. Compilation fails.

  6. 9

  7. 8

    Answer: F

    Question No: 48

    Given:

    1. public class Threads3 implements Runnable {

    2. public void run() {

    3. System.out.print(quot;runningquot;); 4. }

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

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

  3. t.run();

  4. t.run();

  5. t.start();

    10. }

    11. }

    What is the result?

    1. An exception is thrown at runtime.

    2. The code executes and prints quot;runningquot;.

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

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

    5. Compilation fails.

Answer: D

Question No: 49

Click the Exhibit button.

Which statement is true about the set variable on line 12?

Ensurepass 2018 PDF and VCE

  1. The set variable contains only three elements from the coll collection, and the order is

    guaranteed to be preserved.

  2. The set variable contains only three elements from the coll collection, but the order is NOT guaranteed to be preserved.

  3. The set variable contains all six elements from the coll collection, and the order is guaranteed to be preserved.

  4. The set variable contains all six elements from the coll collection, but the order is NOT guaranteed to be preserved.

Answer: B

Question No: 50

Given:

  1. public class Wow {

  2. public static void go(short n) {System.out.println(quot;shortquot;);}

  3. public static void go(Short n) {System.out.println(quot;SHORTquot;);}

  4. public static void go(Long n) {System.out.println(quot; LONGquot;);}

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

  6. Short y = 6;

  7. int z = 7;

  8. go(y);

  9. go(z);

21. }

22. }

What is the result?

  1. short LONG

  2. SHORT LONG

  3. An exception is thrown at runtime.

  4. Compilation fails.

Answer: D

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

Leave a Reply

Your email address will not be published. Required fields are marked *

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