J
JTL.zheng
I see a code like this:
in a Thread:
--------------------------
public void run() {
Thread currentThread = Thread.currentThread();
while (thread == currentThread) {
try {
repaint();
thread.sleep(100);
}
catch (InterruptedException ex) {
}
}
}
---------------------------
what's the "while (thread == currentThread) " codes mean?
what is it used for?
Thank you in advance.
in a Thread:
--------------------------
public void run() {
Thread currentThread = Thread.currentThread();
while (thread == currentThread) {
try {
repaint();
thread.sleep(100);
}
catch (InterruptedException ex) {
}
}
}
---------------------------
what's the "while (thread == currentThread) " codes mean?
what is it used for?
Thank you in advance.