Write a class named GasTank containing: An instance variable named amount of type double, initialized to 0. An instance variable named capacity of type double.

java

LANGUAGE: JAVA CHALLENGE: Write a class named GasTank containing: An instance variable named amount of type double , initialized to 0. An instance variable named capacity of type double. A constructor that accepts a parameter of type double . The value of the parameter is used to initialize the value of capacity. A method named addGas…

Read More