1. Engineering
  2. Computer Science
  3. question1 java class question2 find error...

Question: question1 java class question2 find error...

Question details
question#1: java class


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.
question#2: find error

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
Solution by an expert tutor
Blurred Solution
This question has been solved
Subscribe to see this solution