Developing Algorithms Using Strings

AP Computer Science A· difficulty 4/5

What does this print?

<code>String s = "abc"; for (int i = 0; i < s.length(); i++) System.out.print(s.charAt(i)); </code></pre>

  • A

    0 1 2

  • B

    cba

  • C

    abc

    check_circle
  • D

    abcabc

Explanation

Iterates over characters.

Want 10 more like this — adaptive to your weak spots?

Related questions