for Loops

AP Computer Science A· difficulty 4/5

Two nested for-loops cannot use

  • A

    Different names (recommended)

  • B

    Independent variables

  • C

    Same conditions

  • D

    The same loop variable name (compile error)

    check_circle

Explanation

Java forbids redeclaring a variable in inner scope when the outer is still live.

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

Related questions