Skip to content

Conversation

@Asizell
Copy link

@Asizell Asizell commented Aug 25, 2023

Попытка сдать дз

System.out.println("Введено некорректное значение");
}else {
Product product = new Product(productName, productPrice);
calculator.addProduct(product,1);

Choose a reason for hiding this comment

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

Можно также не создавать переменную, а создавать объект при вызове метода:
calculator.addProduct(new Product(productName, productPrice),1);

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