Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package Battery;
- public class Battery {
- public static void main(String[] args) {
- Battery batt = new Battery();
- batt.drain(amount);
- batt.fill(amount);
- batt.charge(amount);
- System.out.println(charge);
- }
- private static double charge;
- private static double amount;
- private double charge(double amount) {
- amount = 3000;
- return charge;
- }
- public void drain(double amount) {
- charge = amount - 300;
- }
- public void fill(double amount) {
- charge = amount + 300;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment