Practice basic problems in Java