閱讀73 返回首頁    go 阿裏雲 go 技術社區[雲棲]


自己寫的一段重試代碼

public class TestRetry {

	public static void main(String[] args) {
		retry(5);
	}
	
	private static void retry(int maxCount) {
		int count = 0;
		boolean result = false;
		do {
			count++;
			System.out.println("count="+count);
/*			if(count==2) {
				result = true;
			}*/
		} while (count<maxCount && result == false);
	}
}

最後更新:2017-04-03 08:26:19

  上一篇:go 有意思的遊戲:Google XSS Game
  下一篇:go 2014百度聯盟峰會:預計分成70億,技術創新引領產業變革