-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMobileDevice.java
More file actions
63 lines (47 loc) · 1.29 KB
/
Copy pathMobileDevice.java
File metadata and controls
63 lines (47 loc) · 1.29 KB
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
public class MobileDevice {
private String brandName;
private String modelName;
private int batteryCapacityValue;
private int priceValue;
public MobileDevice(String brand, String model, int batteryCapacity, int price) {
brandName = brand;
modelName = model;
batteryCapacityValue = batteryCapacity;
priceValue = price;
}
public String getBrand() {
return brandName;
}
public void setBrand(String brand) {
brandName = brand;
}
public String getModel() {
return modelName;
}
public void setModel(String model) {
modelName = model;
}
public int getBatteryCapacity() {
return batteryCapacityValue;
}
public void setBatteryCapacity(int batteryCapacity) {
batteryCapacityValue = batteryCapacity;
}
public int getPrice() {
return priceValue;
}
public void setPrice(int price) {
priceValue = price;
}
public void displayDeviceDetails() {
System.out.println("Brand: " + brandName);
System.out.println("Model: " + modelName);
System.out.println("Battery Capacity: " + batteryCapacityValue + " mAh");
System.out.println("Price: " + priceValue);
}
@Override
public String toString() {
return "MobileDevice [BrandName=" + brandName + ", ModelName=" + modelName + ", BatteryCapacityValue="
+ batteryCapacityValue + ",PiceValue=" + priceValue + "].";
}
}