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

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: 51

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. An exception occurs at runtime.

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

  3. Compilation fails.

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

  5. pi is bigger than 3.

Answer: C

Question No: 52

Given:

  1. class Line {

  2. public static class Point {}

12. } 13.

  1. class Triangle {

  2. // insert code here

16. }

Which code, inserted at line 15, creates an instance of the Point class defined in Line?

  1. Line.Point p = new Line.Point();

  2. The Point class cannot be instatiated at line 15.

  3. Point p = new Point();

  4. Line l = new Line() ; l.Point p = new l.Point();

Answer: A

Question No: 53

Given:

  1. String csv = quot;Sue,5,true,3quot;;

  2. Scanner scanner = new Scanner( csv );

  3. scanner.useDelimiter(quot;,quot;);

  4. int age = scanner.nextInt(); What is the result?

  1. After line 15, the value of age is 3.

  2. After line 15, the value of age is 5.

  3. Compilation fails.

  4. An exception is thrown at runtime.

Answer: D

Question No: 54 DRAG DROP

Click the Task button.

Ensurepass 2018 PDF and VCE

Answer:

Ensurepass 2018 PDF and VCE

Question No: 55

Given:

  1. interface DeclareStuff {

  2. public static final int EASY = 3;

  3. void doStuff(int t); }

  4. public class TestDeclare implements DeclareStuff {

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

  6. int x = 5;

  7. new TestDeclare().doStuff( x);

18. }

  1. void doStuff(int s) {

  2. s = EASY s;

  3. System.out.println(quot;s quot; s);

22. }

23. }

What is the result?

  1. Compilation fails.

  2. s 10

  3. s 16

  4. s 14

  5. An exception is thrown at runtime.

    Answer: A

    Question No: 56

    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?

    1. Line 2 of class Target can be changed to private Integer i = 0;

    2. Line 2 of class Target can be changed to private int i = 1;

    3. Line 4 of class Target can be changed to return i ;

    4. Line 3 of class Target can be changed to private int addOne(){

      Answer: A

      Question No: 57

      Given:

      1. package geometry;

      2. public class Hypotenuse {

      3. public InnerTriangle it = new InnerTriangle();

      4. class InnerTriangle {

      5. public int base;

      6. public int height; 7. }

        8. }

        Which statement is true about the class of an object that can reference the variable base?

        1. The class must be a subclass of the class Hypotenuse.

        2. It can be any class.

        3. No class has access to base.

        4. The class must belong to the geometry package.

Answer: D

Question No: 58 DRAG DROP

Click the Task button.

Ensurepass 2018 PDF and VCE

Answer:

Ensurepass 2018 PDF and VCE

Question No: 59

Given:

int[] myArray = new int[] {1, 2, 3, 4, 5};

What allows you to create a list from this array?

  1. List myList = myArray.asList();

  2. List myList = new ArrayList(myArray);

  3. List myList = Collections.fromArray(myArray);

  4. List myList = Arrays.asList(myArray);

Answer: D

Question No: 60

Given:

10: public class Hello { 11: String title;

12: int value;

13: public Hello() { 14: title = quot; Worldquot;; 15: }

16: public Hello(int value) { 17: this.value = value;

18: title = quot;Helloquot;; 19: Hello();

20: }

21: }

and:

30: Hello c = new Hello(5); 31: System.out.println(c.title);

What is the result?

  1. An exception is thrown at runtime.

  2. Compilation fails.

  3. Hello World 5

  4. The code runs with no output.

  5. Hello

  6. Hello World

Answer: B

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.