Write the definitionof a class Telephone . The class has no constructors, oneins
ID: 3614040 • Letter: W
Question
Write the definitionof a class Telephone . The class has no constructors, oneinstance variable of type String called number , andtwo static variables. One is of type int called quantity ; the other is of type double called total .Besides that, the class has one static method makeFullNumber . Themethod accepts two arguments, a String containing a telephonenumber and an int containing an area code. The methodconcatenates the two arguments in the following manner: First comesthe area code, then a dash, then the telephone number. The methodreturns the resultant string.
Explanation / Answer
Hello.. I am glad to help you... public classTelephone {private String number;
private static int quantity;
private static double total;
private static makeFullNumber(String telenumber, intareaCode)
{
System.out.println(areaCode + "-" +telenumber); // This change isimportant...
}
} thank you./ thank you./
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.