nerdexam
Oracle

1Z0-803 · Question #192

Given: What is the result?

The correct answer is E. An exception is thrown at runtime. Exception in thread "main" java.lang.StringIndexOutOfBoundsException: String index out of range: 6 at java.lang.String.substring(Unknown Source)

Working with Selected Classes from the Java API

Question

Given:

What is the result?

Exhibit

1Z0-803 question #192 exhibit

Options

  • Abox
  • Bnbo
  • Cbo
  • Dnb
  • EAn exception is thrown at runtime

How the community answered

(58 responses)
  • A
    3% (2)
  • B
    2% (1)
  • C
    2% (1)
  • D
    9% (5)
  • E
    84% (49)

Explanation

Exception in thread "main" java.lang.StringIndexOutOfBoundsException: String index out of range: 6 at java.lang.String.substring(Unknown Source)

Topics

#String methods#runtime exception#StringIndexOutOfBoundsException

Community Discussion

No community discussion yet for this question.

Full 1Z0-803 Practice