在查看一段代码时:发现run方法中有close: 是什么意思
public void run() {// 重构该方法 close:
while (isPlay) {
for (int i = showIndex; i < maxIndex + 1; i++) {
showPointedPhoto(i);
try {
Thread.sleep((secondComboBox.getSelectedIndex() + 1) * 1000);
while (isPause) {Thread.sleep(500); }
} catch (InterruptedException e) {e.printStackTrace();}
.....................................................
public void run() {// 重构该方法 close:
while (isPlay) {
for (int i = showIndex; i < maxIndex + 1; i++) {
showPointedPhoto(i);
try {
Thread.sleep((secondComboBox.getSelectedIndex() + 1) * 1000);
while (isPause) {Thread.sleep(500); }
} catch (InterruptedException e) {e.printStackTrace();}
.....................................................
close标记的是紧挨着while循环体。
while(true) {
//continue label1; //中断到label1后会继续进入while循环
//break label1; //中断到label1但不会再继续进入while循环
}