-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCard.java
More file actions
55 lines (46 loc) · 1.63 KB
/
Copy pathCard.java
File metadata and controls
55 lines (46 loc) · 1.63 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
import java.util.*;
public class Card {
private String name;
private String number;
private String address;
private String areaCode;
private String location;
public Card(String name, String number, String address) {
this.name = name;
this.number = number;
this.address = address;
}
public Card(String name, String number, String address, String areaCode, String location) {
this(name, number, address);
this.areaCode = areaCode;
this.location = location;
}
public String cardDisplay() {
String toReturn = "\n----------------------------------";
toReturn += "\n\t" + name + "'s" + " Card";
toReturn += "\n----------------------------------\n";
toReturn += "\n" + " Area Code: " + areaCode;
toReturn += "\n" + " Location: " + location;
toReturn += "\n" + " Contact Name: " + name;
toReturn += "\n" + " Contact Number: " + number;
toReturn += "\n" + " Address: ";
toReturn += "\n" + "\t" + address;
toReturn += "\n----------------------------------";
toReturn += "\n\n----------------------------------";
return toReturn;
}
public String toString() {
String toReturn = "\n----------------------------------";
toReturn += "\n\t" + name + "'s" + " Card";
toReturn += "\n----------------------------------\n";
toReturn += "\n" + " Area Code: " + areaCode;
toReturn += "\n" + " Location: " + location;
toReturn += "\n" + " Contact Name: " + name;
toReturn += "\n" + " Contact Number: " + number;
toReturn += "\n" + " Address: ";
toReturn += "\n" + "\t" + address;
toReturn += "\n----------------------------------";
toReturn += "\n\n----------------------------------";
return toReturn;
}
}