F****n 发帖数: 3271 | 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). |
g*****g 发帖数: 34805 | 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).
|
c*****t 发帖数: 1879 | 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).
|
T*********g 发帖数: 496 | 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).
|