请帮我看看这一道题

hnrpc 2003-12-28 07:09:32
In the following class, Which code must replace the <<>> to finish the outerloop (control moves out of the outerloop) ?
class Loop
{
public static void main( String [] args)
{
int x = 0; int y = 0;
outer: for (x = 0; x < 100; x++)
{
middle: for (y = 0 ; y < 100 ; y++)
{
System.out.println("x = " + x + "; y = " + y);
if (y == 10)
{
<<>>
}
}
}
} //End of main()
} // End of class Loop
A continue middle;
B break middle;
C continue outer;
D none of these
E break outer;
答案是E,好像不对,为什么
...全文
29 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
alienbat 2004-01-01
  • 打赏
  • 举报
回复
E是正确的。理由?没理由。从C语言开始语法就这样了。
莫再琪莫再贾 2003-12-31
  • 打赏
  • 举报
回复
E是正确的.
A continue middle; y+1,然后再循环;
B break middle; 跳出内循环;
C continue outer; 转到外循环,进行x+1操作;
D none of these
E break outer 跳出整个循环;
caiyi0903 2003-12-28
  • 打赏
  • 举报
回复
break outer跳出循环,是正确的,哪里不对?
gong1 2003-12-28
  • 打赏
  • 举报
回复
有语法错误。
标点;没有。
^_^
根本没法运行。^_^
这是java写的吗?
^_^

50,530

社区成员

发帖
与我相关
我的任务
社区描述
Java相关技术讨论
javaspring bootspring cloud 技术论坛(原bbs)
社区管理员
  • Java相关社区
  • 小虚竹
  • 谙忆
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧