Code example for BigDecimal

Methods: equals

0
    public BigDecimal getValue(){
        return value;
    } 
     
    public boolean equals(DailyExpense test){
        if(test.getDay() == this.getDay() && test.getMonth() == this.getMonth() && test.getYear() == this.getYear() && test.getValue().equals(this.getValue())){
            return true; 
        }else{ 
            return false; 
        } 
    } 
 
    public void addValue(BigDecimal amount) {
        value.add(amount);
    } 
}