Question: Write a java class encapsulating the concept of a telephone number, assuming a telephone number has only a single attribute: a string representing a telephone
Write a java class encapsulating the concept of a telephone number, assuming a telephone number has only a single attribute: a string representing a telephone number. include a construtor, accessor and mutator, and method toString and equals. Also include methods returnig the area code (the first three digits/characters of the phone number;if there are fewer than 3 characters in the phone number or if the first three are not digits, then this method should return "unknown area code"). write a client class to test all the methods in your class.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
