Write the definition of a class Telephone. The class has no constructors, one instance variable of type String called number, and two static variables. One is of type int called quantity, initialized to 250; the other is of type double called total, initialized to 15658.92.

Respuesta :

Limosa

Answer:

The definition of a class Telephone is given as  

public class Telephone // class telephone

{

String number; // variable  number of type string

static int quantity = 250; // variable  quantity  of type int

static double total = 1565.92;  // variable  total  of type double

}

Explanation:

Following is the description of Statement

  • Create a class "Telephone" by using the keyword class.In that class we declared data member .
  • We declared a variable "number" of type "string" which has no constructor.
  • We declared a variable  "quantity" of type "int" which is a static type variable. The static type variable retains the value during the program execution.
  • We declared a variable  "total" of type "double" which is a static type variable. The static type variable retain the value during the program execution .
ACCESS MORE