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); } }
原文地址:http://blog.csdn.net/opzoonzhuzhengke/article/details/27542145