Ask Question

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.

+1
Answers (1)
  1. 23 April, 06:59
    0
    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.
Know the Answer?
Not Sure About the Answer?
Find an answer to your question 👍 “Write the definition of a class Telephone. The class has no constructors, one instance variable of type String called number, and two ...” in 📗 Computers & Technology if the answers seem to be not correct or there’s no answer. Try a smart search to find answers to similar questions.
Search for Other Answers