Threads are invoked by calling a start() method not by calling run() method.
Means when you call Thread.start() new thread is created.
So You are setting the name of the thread as T1
After exection of
new Thread(new B(),"T1").start();
new thread is generated with name "T1" and B's run metod will be invoked(becz of start())
within this thread u r calling
new A().run(); //output "T1"
this causes A's run() method to call (not a seperate thread) with thread "T1".
new Thread(new A(),"T2").run(); //output "T1"
Tis line again calling A's run() method within same thread "T1".
new Thread(new A(),"T3").start(); //output "T3"
In this line u r creating new thread(becz of start()) with the name "T3".