package ex19;
class MyFile {
public void write() {
try {
Thread.sleep(5000);
System.out.println("파일 쓰기 완료");
} catch (InterruptedException e) {
throw new RuntimeException(e);
}
}
}
class 화가 {
public void 그림그리기() {
System.out.println("그림 그리기 완료");
}
}
// 화가
public class Th03 {
public static void main(String[] args) { // 이걸 잘 해야 좋은 UX
MyFile myFile = new MyFile();
화가 painter = new 화가();
painter.그림그리기();
new Thread(() -> {
myFile.write();
}).start();
painter.그림그리기();
}
}

Share article