Abacus object implemented in Java