-
Notifications
You must be signed in to change notification settings - Fork 27
Expand file tree
/
Copy pathCustomer.java
More file actions
42 lines (34 loc) · 891 Bytes
/
Customer.java
File metadata and controls
42 lines (34 loc) · 891 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
31
32
33
34
35
36
37
38
39
40
41
42
public class Customer {
private static int nextId = 1;
private final int id;
private String name; // نام مشتری
private Address address; // آدرس مشتری
public Customer(String name, Address address) {
this.id = nextId++;
this.name = name;
this.address = address;
}
public int getCustomerNumber() {
return id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public Address getAddress() {
return address;
}
public void setAddress(Address address) {
this.address = address;
}
@Override
public String toString() {
return "Customer{" +
"customerId=" + id +
", name='" + name +
"', address=" + address +
'}';
}
}