Redian新闻
>
我说说两个曾经被人EMBARASS的问题
avatar
我说说两个曾经被人EMBARASS的问题# Java - 爪哇娇娃
F*n
1
1. Does Java support goto (You can type goto in Eclipse and you will be
cheated...)
2. How to declare label in Java ( I sincerely did not know).
avatar
g*g
2
hehe, I don't think you can use goto, but you can use
label:
break label;
That can be handy in multiple level of iterations.

【在 F****n 的大作中提到】
: 1. Does Java support goto (You can type goto in Eclipse and you will be
: cheated...)
: 2. How to declare label in Java ( I sincerely did not know).

avatar
c*t
3
Java can break to a label (which must occur before the loop in which
the break is located). It can be used to break out several loops at
once.
To do a forward break (i.e. goto), you can use a simple trick like this:
do
{
if (...)
break;
}
while (false);

【在 F****n 的大作中提到】
: 1. Does Java support goto (You can type goto in Eclipse and you will be
: cheated...)
: 2. How to declare label in Java ( I sincerely did not know).

avatar
T*g
4
没GOTO, 不过好像JCP打算要加。
label之在循环能用。没啥价值吧。。。

【在 F****n 的大作中提到】
: 1. Does Java support goto (You can type goto in Eclipse and you will be
: cheated...)
: 2. How to declare label in Java ( I sincerely did not know).

相关阅读
logo
联系我们隐私协议©2024 redian.news
Redian新闻
Redian.news刊载任何文章,不代表同意其说法或描述,仅为提供更多信息,也不构成任何建议。文章信息的合法性及真实性由其作者负责,与Redian.news及其运营公司无关。欢迎投稿,如发现稿件侵权,或作者不愿在本网发表文章,请版权拥有者通知本网处理。