-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.java
More file actions
67 lines (60 loc) · 1.93 KB
/
Copy pathmain.java
File metadata and controls
67 lines (60 loc) · 1.93 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
64
65
66
67
abstract class Laptop {
private String brand;
private String model;
private String color;
private String ram;
private String cpu;
private String Storage;
private double price;
private String graphicCard;
abstract void buildLaptop();
public void DisplayLaptopDetails() {
System.out.println("Brand: " + brand);
System.out.println("Model: " + model);
System.out.println("Color: " + color);
System.out.println("RAM: " + ram);
System.out.println("CPU: " + cpu);
System.out.println("Storage: " + Storage);
System.out.println("Price: " + price);
System.out.println("GraphicCard: " + graphicCard);
}
}
class OfficeLaptops extends Laptop {
public OfficeLaptops(String brand, String model, String color, String ram, String cpu, String Storage, double price, String graphicCard) {
this.brand = brand;
this.model = model;
this.color = color;
this.ram = ram;
this.cpu = cpu;
this.Storage = Storage;
this.price = price;
this.graphicCard = graphicCard;
}
@Override
void buildLaptop() {
System.out.println("Build Office Laptop");
}
class GamingLaptops extends Laptop {
public GamingLaptops(String brand, String model, String color, String ram, String cpu, String Storage, double price, String graphicCard) {
this.brand = brand;
this.model = model;
this.color = color;
this.ram = ram;
this.cpu = cpu;
this.Storage = Storage;
this.price = price;
this.graphicCard = graphicCard;
}
@Override
void buildLaptop() {
System.out.println("Build Gaming Laptop");
}
}
//
// public class Main {
// public static void main(String[] args) {
// OfficeLaptops officeLaptops = new OfficeLaptops("Dell","i50","black","35 gb","dell 5110","ssd 2 TB",360,"intel 54T 8GB") {
//
// };
//}
// }