Answer Posted / ranganathkini
An interface can extend 1 or more interfaces. Though this
kind of extension mechanism is limited for classes extending
classes. It is not true for interfaces. Please observe
Interface3 in the following example:
interface Interface1 {
void method1();
}
interface Interface2 {
void method2();
}
interface Interface3 extends Interface1, Interface2 {
void method3();
}
public class InterfaceTest implements Interface3 {
public void method1() {
}
public void method2() {
}
public void method3() {
}
public static void main( String[] args ) {
}
}
| Is This Answer Correct ? | 67 Yes | 3 No |
Post New Answer View All Answers
What is difference between this and super keyword?
Can we compare two strings in java?
Is multiple inheritance supported by java?
Does java trim remove newline?
Write a program to solve producer consumer problem in java?
Does list maintain insertion order java?
What are scriptlets?
What is the parse method in java?
Why convert an applet to an application?
Explain methods specific to list interface?
What is an enumeration?
What is method overriding in java ?
What do you mean by thread safe?
Can a constructor be protected?
How do you convert bytes to character in java?