class B extends A implements Runnable
is valid Java syntax, but doesn't really do anything. By extending A, B is Runnable.
When the run method is called on an A object, A's run method will be called. When run is called on a B object, A's run method will be called unless B overrides A's run method
Consider the following:
class A implements Runnable
{
public void run()
{
System.out.println("A's run method");
}
}
class B extends A implements Runnable
{
public void run()
{
System.out.println("B's run method");
}
}
class Test
{
public static void main(String args[])
{
A obj1 = new A();
A obj2 = new B();
B obj3 = new B();
Runnable obj4 = new A();
Runnable obj5 = new B();
obj1.run(); // prints "A's run method"
obj2.run(); // prints "B's run method"
obj3.run(); // prints "B's run method"
obj4.run(); // prints "A's run method"
obj5.run(); // prints "B's run method"
}
}