Skip to content

Sprint 2 - #1

Open
tLen-tLen wants to merge 2 commits into
devfrom
sprint-2
Open

tLen-tLen wants to merge 2 commits into
devfrom
sprint-2

Conversation

@tLen-tLen

Copy link
Copy Markdown
Owner

No description provided.

@Charmandik Charmandik left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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

Comment thread src/main/java/Main.java
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()

Comment thread src/main/java/Main.java
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