-
Notifications
You must be signed in to change notification settings - Fork 687
Expand file tree
/
Copy pathLaptop.java
More file actions
30 lines (24 loc) · 757 Bytes
/
Laptop.java
File metadata and controls
30 lines (24 loc) · 757 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
package technology;
public class Laptop extends Computer {
private double screenSize;
private double ram;
public Laptop(String operatingSystem, String brand, int yearRelease, double cost, double screenSize, double ram){
super(operatingSystem, brand, yearRelease, cost);
this.screenSize = screenSize;
this.ram = ram;
newId++;
}
public double getScreenSize() {
return screenSize;
}
public double getRam() {
return ram;
}
@Override
public String toString(){
String newline = System.lineSeparator();
return super.toString() +
"Screen Size: " + screenSize + " inches" + newline +
"Ram: " + ram + " G" + newline;
}
}