Question: question#1: java class question#2: find error One variation of the PhoneNumber class of Lab 3.2 is to represent the phone number as three integers for

question#1: java class
 question#1: java class question#2: find error One variation of the PhoneNumber
question#2: find error
class of Lab 3.2 is to represent the phone number as three

One variation of the PhoneNumber class of Lab 3.2 is to represent the phone number as three integers for the individual components: area-code, exchange and line number. Here is a specification for such a class 1. State three integer variables representing the area code, exchange, and line- number of the phone number o Behavior a constructor that accepts three integers representing the area code, exchange, and line number respectively a constructor that accepts two integers -the exchange and line number, and sets the area code to 800. To receive full credit for this you must invoke the three parameter constructor getAreaCode, getExchange, and getlineNumber methods an equale method that returns whether two PhoneNumber objects are equal (i.e., their area code, exchange, and line numbers are all equal). A tostring method that returns the phone number in the format o o o o o a read method that reads in three integers, and uses them to crcate and initialize a PhoneNumber object (sing the three-parm constructor), and returns the new object o Provide the class definition of such a PhoneNumber class. Make sure you inchude public and private, and use them appropriately. (20 points) a. 9. What is wrong with each of the following programs? 1 public class ShowErrors 1 public class ShowErrors 1 2 public static void main(String[] args) 2 public static void main(String[] args) ShowErrors t new ShowErrors(5); ShowErrors t t.xO new ShowErrors(); 4 1 public class ShowErrors 2 public void method10 1 public class ShowErrors 2 public static void main(String[] args) Circle c; System.out.printlnC What is radius" C c new C(S.0); System.out.println(c.value); + c.getRadiusO); c new CircleO 8 class C int value = 2; 10

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!