pencil-icon
Build your own quiz

Computers

10th

grade

Image

Java ArrayLists

user

748
plays

11 questions

Show Answers
See Preview
  • 1. Multiple Choice
    1 minute
    1 pt

    What is the ArrayList nums if it is initially [5, 3, 1] and the following code is executed?

    nums.add(6);

    nums.add(0, 4);

    nums.remove(1);

    [4, 3, 1, 6]

    [5, 3, 1, 6]

    [4, 3, 6]

    [4, 5, 3, 6]

  • 2. Multiple Choice
    30 seconds
    1 pt

    What index value is used to locate the last element in the nums ArrayList?

    nums.size()-1

    nums.length()-1

    nums.size()

    nums.length

  • 3. Multiple Choice
    30 seconds
    1 pt

    Which statement below is the correct way to retrieve the first element in the nums ArrayList?

    nums.get(0)

    nums[0]

    nums(0)

    nums[1]

  • Answer choices
    Tags
    Answer choices
    Tags

    Explore all questions with a free account

    Already have an account?