Читать книгу OCP Oracle Certified Professional Java SE 17 Developer Study Guide - Jeanne Boyarsky - Страница 203

Modifying Loop Variables

Оглавление

As a general rule, it is considered a poor coding practice to modify loop variables due to the unpredictability of the result, such as in the following examples:

for(int i=0; i<10; i++) i = 0; for(int j=1; j<10; j++) j++;

It also tends to make code difficult for other people to follow.

OCP Oracle Certified Professional Java SE 17 Developer Study Guide

Подняться наверх