-
Notifications
You must be signed in to change notification settings - Fork 685
Expand file tree
/
Copy pathComputer.java
More file actions
47 lines (37 loc) · 1.09 KB
/
Computer.java
File metadata and controls
47 lines (37 loc) · 1.09 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
package technology;
public class Computer extends AbstractEntity{
private String operatingSystem;
private String brand;
private int yearRelease;
private double cost;
public Computer(String operatingSystem, String brand, int yearRelease, double cost){
this.operatingSystem = operatingSystem;
this.brand = brand;
this.yearRelease = yearRelease;
this.cost = cost;
}
public String getOperatingSystem() {
return operatingSystem;
}
public String getBrand() {
return brand;
}
public int getYearRelease() {
return yearRelease;
}
public void setCost(double cost) {
this.cost = cost;
}
public double getCost() {
return cost;
}
@Override
public String toString(){
String newline = System.lineSeparator();
return "Product Information: " + newline +
"ID: " + getId() + newline +
"OS: " + operatingSystem + newline +
"Released: " + yearRelease + newline +
"Price: $" + cost + newline;
}
}