Skip to content

Sprint 2#1

Open
tLen-tLen wants to merge 2 commits intodevfrom
sprint-2
Open

Sprint 2#1
tLen-tLen wants to merge 2 commits intodevfrom
sprint-2

Conversation

@tLen-tLen
Copy link
Copy Markdown
Owner

No description provided.

Copy link
Copy Markdown

@Charmandik Charmandik left a comment

Choose a reason for hiding this comment

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

Хорошая работа, продолжай в том же духе!

Scanner scanner = new Scanner(System.in);
System.out.println("Введите название товара");

return scanner.next();
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

при использовании этого метода считывается только первое слово. Попробуй использовать метод nextLine()

try {
System.out.println("Введите стоимость товара");
Scanner scanner = new Scanner(System.in);
price = scanner.nextDouble();
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

при использовании сканера хорошим тоном является использование метода .close у сканера, это позволяет избежать возможных утечек памяти

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.

2 participants