-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathContact.java
37 lines (33 loc) · 852 Bytes
/
Contact.java
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
public class Contact {
private String firstName;
private String lastName;
private int phoneNumber;
private String email;
public Contact(String firstName, String lastName, int phoneNumber, String email){
this.firstName = firstName;
this.lastName = lastName;
this.phoneNumber = phoneNumber;
this.email = email;
}
public String getFirstName()
{
return this.firstName;
}
public String getLastName()
{
return this.lastName;
}
public int getPhoneNumber()
{
return this.phoneNumber;
}
public String getEmail()
{
return this.email;
}
public String toString()
{
return "Name: " + this.firstName + " " + this.lastName + "\n" +
"Email: " + this.email + " Phone: " + this.phoneNumber + "\n";
}
}