Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Car.java MrG 2011.1004
- public class Car
- {
- private double mpg;
- private double tank;
- public Car(double mpg)
- {
- this.mpg=mpg;
- this.tank=0;
- }
- public double getGasInTank()
- {
- return tank;
- }
- public void addGas(double gas)
- {
- tank=tank+gas;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement