Guest User

Untitled

a guest
Apr 6th, 2020
190
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.53 KB | None | 0 0
  1. class Glass {
  2.        
  3.         int capacity = 0;
  4.  
  5.         void add(int value) {
  6.             System.out.println("Było " + capacity);
  7.             System.out.println("Dodaj " + value);
  8.             capacity += value;
  9.             System.out.println("Teraz jest " + capacity);
  10.         }
  11.  
  12.         void subtract(int value) {
  13.             System.out.println("Było " + capacity);
  14.             System.out.println("Odejmij " + value);
  15.             capacity -= value;
  16.             System.out.println("Teraz jest " + capacity);
  17.         }
  18.     }
Advertisement
Add Comment
Please, Sign In to add comment