1z0-808 Java SE 8 Programmer

Loading demo links...

Showing 1–3 of 15 questions

Question 1

Which three are advantages of the Java exception mechanism? (Choose three.)

Select all that apply, then click Submit answer.

  • Improves the program structure because the error handling code is separated from the normal program function

  • Provides a set of standard exceptions that covers all possible errors

  • Improves the program structure because the programmer can choose where to handle exceptions

  • Improves the program structure because exceptions must be handled in the method in which they occurred

  • Allows the creation of new exceptions that are customized to the particular program being created

Question 2

Given:

And given the code fragment:

and this output: Canine 60 Long

Feline 80 Short

Which two modifications enable the code to print this output? (Choose two.)

Select all that apply, then click Submit answer.

  • . Replace line n1 with:

  • Replace line n1 with:

  • Replace line n2 with:

  • Replace line n1 with:

  • Replace line n2 with:


Question 3

Given this class:

And given this main method, located in another class:

Which three lines, when inserted independently at line n1, cause the program to print a 0 balance? (Choose three.)

Select all that apply, then click Submit answer.

  • acct.setAmount(-acct.getAmount());

  • acct.amount = 0;

  • acct.setAmount(0);

  • acct.getAmount() = 0;

  • this.amount = 0;

  • acct.changeAmount(0);

  • acct.changeAmount(-acct.amount);