run method in Thread class
<p>The output is : RunnableA ThreadB<br>
I don't understand how it comes?? (what happens in the run method in class B)</p>

<pre><code>class A implements Runnable{
    public void run(){
        System.out.println("RunnableA");
    }
}
class B extends Thread{
    B(Runnable r){
        super(r);
    }
    public void run(){
        super.run();
        System.out.println("ThreadB");
    }
}
class Demo{
    public static void main (String []args){
        A a=new A();
        Thread t=new B(a);
        t.run();
    }
}
</code></pre>
