-
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.
hasNextInt
src/main/java/DivisionCheck.java
Outdated
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.
Лучшее переиспользовать инстанс Scanner, а не создавать каждый раз новый.
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.
Тоже самое, что и с hasNextInt только тут надо hasNextFloat
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.
Можно воспользоваться циклом foreach, было бы удобнее, подробнее можно почитать тут
https://javarush.com/groups/posts/for-each-java
1) использовал методы hasNext() для обработки введённой пользователем инфармации 2) теперь переиспользуется инстанс Scanner, без пересоздания в каждом цикле как было
Uh oh!
There was an error while loading. Please reload this page.
Первый ПР к консольному приложению калькулятор счёта