Skip to content

Conversation

@alexpopov06
Copy link
Owner

No description provided.

Comment on lines +9 to +11
System.out.println("Введите название машины №" + i);
String carName = scanner.next();
int carSpeed = 0;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Переменные рекомендуется объявлять максимально близко к их первому месту использования для читабельности кода

Comment on lines +38 to +39
String carName;
int carSpeed;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Поля лучше пометить final, тем самым исключив возможность их модификации извне

}
}

public String Winner() {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Названия функций принято делать глаголами и с маленькой буквы, хорошим неймингом здесь будет getWinner()

Comment on lines +48 to +49
int distance = 0;
String carNameq = "";

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Переменные лучше сделать приватными, чтобы исключить их модификацию извне

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants