java 递归返回

     private Integer getAvailableQuestionId(String totalIdsKey,String answeredKey){
		//获得可用答题id
		Set availableIds = Redis.use().sdiff(totalIdsKey, answeredKey);
		if (availableIds.size()==0) {
			Redis.use().del(answeredKey);
			return getAvailableQuestionId(totalIdsKey,answeredKey);
		}
		return (Integer) availableIds.iterator().next();
	}

 

你可能感兴趣的:(java)