Reputation: 14222
When a class implements an interface, do the subclasses inherit the implemented interfaces too? For example
class A implements Runnable
{
public void run()
{
// do something
}
}
class B extends A
{
public static void main(String[] args)
{
new Thread(new B()).start(); //works
}
}
does this mean the implements clause also gets inherited?
Upvotes: 3
Views: 154
Reputation: 12562
Class A IS-A Runnable, and class B IS-A A, so class B IS-A RUNNABLE. Yes, they do.
Upvotes: 5