A Developer Gateway To IT World...

Techie Uncle Software Testing Core Java Java Spring C Programming Operating System HTML 5 Java 8 ES6 Project

How a class implements Runnable?


class A implements Runnable { public void run() { System.out.println("Hello This is "+Thread.currentThread().getName()); } } class Three { public static void main(String args[]) { A obj=new A(); Thread t1=new Thread(obj,"Alex"); Thread t2=new Thread(obj,"Smith"); Thread t3=new Thread(obj,"John"); t1.start(); t2.start(); t3.start(); System.out.println("Hello This is "+Thread.currentThread().getName()); } }

LEARN TUTORIALS

.

.