nerdexam
Oracle

1Z0-819 · Question #125

Given the code fragment: int[] secA = { 1, 2, 4, 6, 8, 10 }; int[] secB = { 1, 2, 4, 6, 8, 10 }; int res1 = Arrays.mismatch(secA, secB); int res2 = Arrays.compare(secA, secB); System.out.print(res1…

The correct answer is B. 2, 1. See the full explanation below for the reasoning.

Question

Given the code fragment: int[] secA = { 1, 2, 4, 6, 8, 10 }; int[] secB = { 1, 2, 4, 6, 8, 10 }; int res1 = Arrays.mismatch(secA, secB); int res2 = Arrays.compare(secA, secB); System.out.print(res1 + " " + res2); What is the result?

Options

  • A1, 2
  • B2, 1
  • C2, 3
  • D3, 0

How the community answered

(44 responses)
  • A
    11% (5)
  • B
    80% (35)
  • C
    2% (1)
  • D
    7% (3)

Community Discussion

No community discussion yet for this question.

Full 1Z0-819 Practice