-
Notifications
You must be signed in to change notification settings - Fork 100
Expand file tree
/
Copy pathProduct.java
More file actions
44 lines (35 loc) · 841 Bytes
/
Product.java
File metadata and controls
44 lines (35 loc) · 841 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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
package com.booleanuk.api;
public class Product {
private static int nextId = 1;
private final int id;
private String name;
private String category;
private int price;
public Product(String name, String category, int price) {
this.id = nextId++;
this.name = name;
this.category = category;
this.price = price;
}
public int getId() {
return id;
}
public String getName() {
return name;
}
public String getCategory() {
return category;
}
public int getPrice() {
return price;
}
public void setName(String name) {
this.name = name;
}
public void setCategory(String category) {
this.category = category;
}
public void setPrice(int price) {
this.price = price;
}
}