Skip to content

Conversation

@MSrescuer
Copy link
Owner

No description provided.

System.out.println("Hello world!");
Calculator calc = new Calculator();
while (true) {
Scanner scanner = new Scanner(System.in);

Choose a reason for hiding this comment

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

Лучше не создавать каждую новую итерацию объект Scanner, сильно нагружает сборщик мусора
И нам хватит одного сканера на проект

System.out.println("Введите Завершить для подсчёта, или любой символ что-бы добавить еще товар");
String end = scanner.next();
if (end.equalsIgnoreCase("Завершить") || productInput.equalsIgnoreCase("Завершить")) {
System.out.println("Рассчёт завершён.");

Choose a reason for hiding this comment

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

typo

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