package thread;
public class HelloThread {
public static void main(String [] args){
Hello h =new Hello();
Hello2 h2 =new Hello2();
h2.run();
h.start();
for(int i=0 ;i <10 ;i++){
h.printHello();
System.out.println(Thread.currentThread().getName());
}
}
}
class Hello extends Thread{
public void printHello(){
System.out.println("hello");
}
}
class Hello2 implements Runnable{
public void run(){
System.out.println("hello 2");
}
}