Computers

9th -

12thgrade

Image

Java Strings

453
plays

12 questions

Show Answers
See Preview
  • 1. Multiple Choice
    20 seconds
    1 pt

    int len = "jump it!".length();


    What is the value of len?

    8

    7

    9

    6

    This code does not compile.

  • 2. Multiple Choice
    30 seconds
    1 pt

    int x = "quarantine".indexOf("a");


    What is the value of x?

    4

    3

    2

    This code does not compile.

    StringIndexOutOfBoundsException

  • 3. Multiple Choice
    20 seconds
    1 pt

    String s = "whatever".substring(1,4);


    What is the value of s?

    "hate"

    "hat"

    "whate"

    "what"

    StringIndexOutOfBoundsException

  • Answer choices
    Tags
    Answer choices
    Tags

    Explore all questions with a free account

    Already have an account?