forked from Yandex-Practicum/Java-Module-Project
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProduct.java
More file actions
28 lines (23 loc) · 814 Bytes
/
Product.java
File metadata and controls
28 lines (23 loc) · 814 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
public class Product {
/* На основе этого класса будут созданы объекты Product, которые будут служить
исходным материалом для расчета общей стоимости заказа
*/
// наименование товара
private final String name;
// стоимость товара
private final double value;
public Product(String name, double value) {
this.name = name;
this.value = value;
}
public String getName() {
return this.name;
}
public double getValue() {
return this.value;
}
@Override
public String toString() {
return "Наименование: " + this.name + ", Стоимость: " + this.value;
}
}