package com.javaex.thread.ex03; public class MainThread { public static void main(String[] args) { // ì°ë ë를 ë¶ë¬ì ì¤í // Thread thread = new DigitThread(); Thread thread = new Thread(new DigitThread()); // ì°ë ëì ìì thread.start(); // ë©ì¸ ì°ë ëì ì½ë를 ë§ë¤ê² ìµëë¤. /* - > AlphabetThreadë¡ ì´ë for (char ch = 'A'; ch <= 'Z'; ch++) { System.out.println(ch); // ì¶ë ¥ ìë ì§ì° try { Thread.sleep(300); } catch (InterruptedException e) { e.printStackTrace(); } } */ // Thread thread2 = new AlphabetThread(); Thread thread2 = new Thread(new AlphabetThread()); thread2.start(); // threadì thread2를 ë©ì¸ ì°ë ëì íë¦ì í©ë¥ try { thread.join(); thread2.join(); } catch (InterruptedException e) { e.printStackTrace(); } System.out.println("ë©ì¸ì°ë ë ì¢ ë£"); } }