-
Notifications
You must be signed in to change notification settings - Fork 0
Comments
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Поля лучше пометить final, тем самым исключив возможность их модификации извне
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Молодец, что не забыл закрыть сканнер - это очень важно)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Данные переменные лучше сделать приватными, чтобы извне нельзя было сломать логику работы этого класса, а для получения названия машины-победителя написать отдельную функцию геттер. Таким образом, весь алгоритм по определению победителя будет инкапсулирован в этом классе - это облегчит тестирование и поддержку этой функциональности
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Данный вызов может выбросить креш, если вместо числа ввести символы - этот эксепшн необходимо обработать, предложив пользователю ввести данные заново
No description provided.