Basic calculator in Java