-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCar_v2.java
More file actions
95 lines (71 loc) · 1.77 KB
/
Car_v2.java
File metadata and controls
95 lines (71 loc) · 1.77 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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
package ua.itstep.homework;
public class Car {
static int id;
private int year;
private int price;
private int regNumber;
private String name;
private String model;
private String color;
Car(String name, String model, int year, String color, int price, int regNumber){
setId(id);
setName(name);
//System.out.println("Марка: " + getName());
setModel(model);
//System.out.println("Модель: " + getModel());
setYear(year);
//System.out.println("Год выпуска: " + getYear());
setColor(color);
//System.out.println("Цвет: " + getColor());
setPrice(price);
//System.out.println("Цена: " + getPrice());
setRegNumber(regNumber);
//System.out.println("Рег. номер: " + getYear());
System.out.println(toString());
}
public int getId() {
return id;
}
public void setId(int id) {
Car.id = id+1;
}
public int getYear() {
return year;
}
public void setYear(int year) {
this.year = year;
}
public int getPrice() {
return price;
}
public void setPrice(int price) {
this.price = price;
}
public int getRegNumber() {
return regNumber;
}
public void setRegNumber(int regNumber) {
this.regNumber = regNumber;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getModel() {
return model;
}
public void setModel(String model) {
this.model = model;
}
public String getColor() {
return color;
}
public void setColor(String color) {
this.color = color;
}
public String toString() {
return getId() + "\t" + getName() + "\t" + getModel() + "\t" + getYear() + "\t" + getColor() + "\t" + getPrice() + "\t" + getRegNumber();
}
}