nerdexam
Oracle

1Z0-851 · Question #200

Given: String test = "a1b2c3"; String[] tokens = test.split("\\d"); for(String s: tokens) System.out.print(s + " "); What is the result?

The correct answer is A. a b c. See the full explanation below for the reasoning.

Question

Given: String test = "a1b2c3"; String[] tokens = test.split("\d"); for(String s: tokens) System.out.print(s + " "); What is the result?

Options

  • Aa b c
  • B1 2 3
  • Ca1b2c3
  • Da1 b2 c3
  • ECompilation fails.
  • FThe code runs with no output.
  • GAn exception is thrown at runtime.

How the community answered

(48 responses)
  • A
    79% (38)
  • B
    2% (1)
  • C
    6% (3)
  • D
    10% (5)
  • E
    2% (1)

Community Discussion

No community discussion yet for this question.

Full 1Z0-851 Practice