Program that accepts user input in Java