Originally posted by monty6:
I just can not find the answer to these question.
1. When an interface extends another interface. Can it extend more than one interface?
Yes. When you actually implement the interface, you're required to define all the methods in all interfaces that the implemented interface extends, or you get an error when compiling.
2. When an interface extend another interface. Do you have to implemnt all if the extended interface methods.
interface interface1{
public void method1();
}
interface interface2{
public void method2();
}
interface interface3 extends interface1, interface2{
public void method3();
}
public class tester implements interface3{
public void method1(){}
public void method2(){}
public void method3(){}
// ... and so on.
}
3. When an interface implement's another interface. Can it implement more than one interface?
An interface cannot implement another interface. It can only extend.
4. When an interface implement's another interface. Do you have to implemnt all if the implemented interface methods.
See above.