do while 限制循环次数问题
public class WhileDo
{
public static void main(String[] args)
{
boolean b = true;
do
{
System.out.println("Execute WhileDo while b is true");
}
while (b);
}
}
如何限定do执行的次数,比如System.out.println("Execute WhileDo while b is true");输出六次就结束程序