public static void main(String[] args) {
//匿名内部类
new Thread(new Runnable() {
@Override
public void run() {
while (true){
System.out.println("播放背景音乐...");
}
}
}).start();
//lambda
new Thread(()->{
while (true){
System.out.println("显示画面...");
}
}).start();
}

相关文章:

  • 2022-01-23
  • 2021-06-10
  • 2021-05-25
  • 2021-12-03
  • 2021-06-17
  • 2021-10-11
  • 2021-12-02
  • 2021-05-26
猜你喜欢
  • 2021-09-08
  • 2022-12-23
  • 2021-04-29
  • 2021-12-28
  • 2021-08-07
  • 2022-02-10
  • 2022-12-23
相关资源
相似解决方案