1z0-808 Java SE 8 Programmer

Loading demo links...

Showing 13–15 of 15 questions

Question 13

Given:

Given the code fragment:

Which two sets of actions, independently, enable the code fragment to print Fit?

Select an option, then click Submit answer.

  • At line n1 insert: import clothing.Shirt;
    At line n2 insert: String color = Shirt.getColor();

  • At line n1 insert: import clothing;
    At line n2 insert: String color = Shirt.getColor();

  • At line n1 insert: import static clothing.Shirt.getColor; At line n2 insert: String color = getColor();

  • At line n1 no changes required.
    At line n2 insert: String color = Shirt.getColor();

  • At line n1 insert: import Shirt;
    At line n2 insert: String color = Shirt.getColor();

Question 14

Given the code fragment:

Which modification enables the code to print 54321?

Select an option, then click Submit answer.

  • Replace line 6 with System.out.print (--x);

  • At line 7, insert x --;

  • Replace line 5 with while (is Available(--x)) {

  • Replace line 12 with return (x > 0) ? false : true;

Question 15

Given the code fragment:

What is the result?

Select an option, then click Submit answer.

  • 1 2 3 0 0
    1 2 3 0 0

  • An Exception is thrown at run time.

  • 1 2 3 0 0
    1 2 3

  • 1 2 3
    1 2 3