help please!
If you specify in your code that a certain class implements a certain interface, is that interface automatically implemented by the subclasses of the class, or do you have to type "implements Interface" at the top of each subclass
i thought they would inheret it
Message was edited by:
StaceyMach
Test it out.
class Superclass implements Runnable
{
public void run()
{
//...
}
}
class Subclass extends Superclass
{
}
class Test
{
public static void main(String[] args)
{
Thread t1 = new Thread(new Superclass());
Thread t2 = new Thread(new Subclass());
}
}
Does it give you any errors?
Another fun test:
abstract class Superclass implements Runnable {
// nothing here
}
class Subclass extends Superclass {
// nothing here either
}
Can you compile Subclass, and if not, why?