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.

Language: Java

Challenge:

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.

SOLUTION:

Language: Java

Challenge:

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.

Solution:

public class Telephone{
    private String number;
    private static int quantity = 250;
    private static double total = 15658.92;
}