正在加载图片...
while Loop pitfall -1 int product =0 while( product 500000)i product= product 5i Infinite Loops Both loops will not terminate because the 2) int count =1 boolean expressions will never become false while( count count count 2 C 2000 McGraw-Hill troduction to Object-Oriented Programming with Java--Wu Chapter 7-8© 2000 McGraw-Hill Introduction to Object-Oriented Programming with Java--Wu Chapter 7 - 8 while Loop Pitfall - 1 Infinite Loops Both loops will not terminate because the boolean expressions will never become false. int count = 1; while ( count != 10 ) { count = count + 2; } 2 int product = 0; while ( product < 500000 ) { product = product * 5; } 1
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有