Can anyone help me to find a different solution for this one ? Implement your to
ID: 3704177 • Letter: C
Question
Can anyone help me to find a different solution for this one ?
Implement your toString method. The output should be in the format Name: For example, if a contact has the first name John, last name Doe and middle (Phone Number:_ name Xavier, and the phone number 123-456-7890, this should return: Name: Doe, John Xavier (Phone Number: 123-456-7890) *Do not insert new line character after the last digit of the phone number. public String toStringO return String.format("Name : %s (Phone Number: %s)", name . toString(), phoneNumber);Explanation / Answer
Answer:
public String toString() {
return "Name: "+name+" (Phone Number: "+phoneNumber+")";
}