1z0-808 Practice Test

1z0-808 Practice Test practice questions, page 9 of 10, with answer review and explanations.

Question 41

Given the following code: What is the output?

  1. 4
  2. 3
  3. 4
  4. 5
  5. 4
  6. 4

Question 42

You are developing a banking module. You have developed a class named ccMask that has a maskcc method. Given the code fragment: You must ensure that the maskcc method returns a string that hides all digits of the credit card number except the four last digits (and the hyphens that separate each group of four digits). Which two code fragments should you use at line n1, independently, to achieve this requirement? (Choose two.)

  1. Option A
  2. Option B
  3. Option C
  4. Option D

Question 43

Given: Acc.java: Which statement is true?

  1. Both p and s are accessible via obj.
  2. Only s is accessible via obj.
  3. Both r and s are accessible via obj.
  4. p, r, and s are accessible via obj.

Question 44

Given: What is the result?

  1. Base DerivedA
  2. Base DerivedB
  3. DerivedB DerivedB
  4. DerivedB DerivedA
  5. A ClassCastException is thrown at runtime.

Question 45

Given the code fragment: What is the result?

  1. Execution terminates in the first catch statement, and Caught a RuntimeException is printed to the console.
  2. Execution terminates in the second catch statement, and Caught an Exception is printed to the console.
  3. A runtime error is thrown in the thread "main".
  4. Execution completes normally, and Ready to use is printed to the console.
  5. The code fails to compile because a throws keyword is required.