how to check if input is double in java