java make sure only one condition is true

Solutions on MaxInterview for java make sure only one condition is true by the best coders in the world