| Constructor and Description |
|---|
Contact(PhoneNumber phoneNumber)
Initialize the contact with its name and its phone number.
|
Contact(String phoneNumber)
Initialize the contact with its phone number as string.
|
Contact(String name,
PhoneNumber phoneNumber)
Initialize the contact with its name and its phone number.
|
Contact(String name,
String phoneNumber)
Initialize the contact with its name and its phone number as string.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object obj) |
String |
getName() |
PhoneNumber |
getPhoneNumber() |
int |
hashCode() |
void |
setPhoneNumber(PhoneNumber phoneNumber) |
String |
toString() |
public Contact(String phoneNumber)
No name is specified.
phoneNumber - the phone number for the contactpublic Contact(String name, String phoneNumber)
name - the name of the contactphoneNumber - the phone number for the contact as stringpublic Contact(PhoneNumber phoneNumber)
No name is specified.
phoneNumber - the phone number for the contactpublic Contact(String name, PhoneNumber phoneNumber)
name - the name of the contactphoneNumber - the phone number for the contactpublic String getName()
public PhoneNumber getPhoneNumber()
public void setPhoneNumber(PhoneNumber phoneNumber)
Copyright © 2021. All rights reserved.