class MyRunnable implements Runnable { String name; MyRunnable(String n) { name = n; } public void run() { int i; for (i=0; i<10; i++) { try { Thread.sleep(10); // 10ミリ秒お休み } catch (InterruptedException e) {} System.out.printf("%s: %d, ", name, i); } } } public class ThreadTest { public static void main(String[] args) { Thread ta = new Thread(new MyRunnable("A")); Thread tb = new Thread(new MyRunnable("B")); Thread tc = new Thread(new MyRunnable("C")); ta.start(); tb.start(); tc.start(); } }