Java implementation calculator can perform simple operations