用Lambda 表达式实现Runnable
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();
}