-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathEncapsulation.java
More file actions
37 lines (36 loc) · 994 Bytes
/
Encapsulation.java
File metadata and controls
37 lines (36 loc) · 994 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
public class Encapsulation {
private String productId;
private String productName;
private int quantity;
private double price;
public Encapsulation(String productId, String productName, int quantity, double price) {
this.productId = productId;
this.productName = productName;
this.quantity = quantity;
this.price = price;
}
public String getProductId() {
return productId;
}
public void setProductId(String productId) {
this.productId = productId;
}
public String getProductName() {
return productName;
}
public void setProductName(String productName) {
this.productName = productName;
}
public int getQuantity() {
return quantity;
}
public void setQuantity(int quantity) {
this.quantity = quantity;
}
public double getPrice() {
return price;
}
public void setPrice(double price) {
this.price = price;
}
}