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
Can a class have multiple constructors?
What is the impact of declaring a method as final?
How many types of classes are there in java?
What is thread pool? How can we create thread pool in java?
What is function and its uses?
What is meant by nested loop?
What is the independent variable in an experiment?
If a class is declared without any access modifiers, where can the class be accessed?
Which is bigger float or double?
What is abstract class constructor called?
Why singleton is not thread safe?
What is meant by call by reference?
Can we use catch statement for checked exceptions?
what methods would you overwrite in java.lang.object class?
How do you declare a variable?