Console calculator in Java