Which of these options most closely matches the original design:

for (int i = 0; i < 10; i++) {
    System.out.println(i);
}
Explanation
The scope of the variable i, declared in the header of the cycle, is limited by this cycle.
In order to limit the scope of the variable you need to use an external block
{
  int i = 0;
  . . .
}

Следи за CodeGalaxy

Мобильное приложение Beta

Get it on Google Play
Обратная Связь
Продолжайте изучать
тесты по Java
Cosmo
Зарегистрируйся сейчас
или Подпишись на будущие тесты