Ask Question
27 March, 23:37

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.

+2
Answers (1)
  1. 28 March, 01:39
    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 and Technology if you're in doubt about the correctness of the answers or there's no answer, then try to use the smart search and find answers to the similar questions.
Search for Other Answers