Question: java without using loop or while just if Write a class called PhoneBook that is used to keep track of a person contacts. Your class
java without using loop or while just if


Write a class called PhoneBook that is used to keep track of a person contacts. Your class should store the name, phone number and email. Assume each user has 2 contacts only. Read the contacts information from the user. Your call should have a constructor that sets all the variables. Your class should have a set and get method for each instance variable. Write a test class to test you class capabilities Sample Output: Enter name 1: Ahmed Salem Enter phone number 1: 99887733 Does he/she have an email (1. Yes - 2. No): 2 Enter email 1: a.h@gmail.com Enter name 2: Khalid Ameer Enter phone number 2: 66773443 Does he/she have an email (1. Yes - 2. No):2 Phone Book: Name 1: Ahmed Salem Phone Number 1: 99887733 Email 1: a.h@gmail.com
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
