questions based on if else statement in java