```java class mythread extends thread { public void run() { for (int i = 0; i < 5; i++) { system.out.println(thread.currentthread().getname() + " - " + i); } } }
public class main { public static void main(string[] args) { mythread thread1 = new mythread(); mythread thread2 = new mythread(); thread1.start(); thread2.start(); } } ```