public void addCandy(Candy candy) { this.candyPresent[getCountCandyInPresent()] = candy; setCountCandyInPresent(getCountCandyInPresent() + 1); this.setWeight(this.getWeight() + candy.getWeight()); this.setPrice(this.getPrice() + candy.getPrice()); this.setSugarCandy(this.getSugarCandy() + candy.getSugarSweetness()); }