-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathVipCustomer.java
More file actions
43 lines (32 loc) · 1.22 KB
/
VipCustomer.java
File metadata and controls
43 lines (32 loc) · 1.22 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
package eu.rideg;
public class VipCustomer {
private String customerName; // customer name
private double creditLimit; // credit limit
private String emailAddress; // e-mail address
// 1st constructor for default values
public VipCustomer() {
this("Default VIP customer name", 999999, "old_default_vip@mail.com");
System.out.println("First constructor with default values was called.");
}
// 2nd constructor with two values and default value for 3rd field
public VipCustomer(String customerName, double creditLimit) {
this(customerName, creditLimit, "new_default_vip@mail.com");
}
// 3rd constructor for saving all fields
public VipCustomer(String customerName, double creditLimit, String emailAddress) {
this.customerName = customerName;
this.creditLimit = creditLimit;
this.emailAddress = emailAddress;
}
// Definition of getters
public String getCustomerName() {
return customerName;
}
public double getCreditLimit() {
return creditLimit;
}
public String getEmailAddress() {
return emailAddress;
}
// Setters are not necessary
}