for
while
do
示例:
for (;;) { }
使用 放置在 Thread.run 中时忽略 选项忽略 Thread.run 中的无限循环语句。 它可能对守护线程有用。
Thread.run
new Thread(() -> { while (true) { } }).start();