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 a local class in java?
Can a method inside a interface be declared as final?
What do you understand by the bean persistent property?
Why is logger singleton?
In a program, initializing an array of 100 KB is throwing an out of memory exception while there is 100 MB of memory available. Why?
How many bits is size_t?
Can we call a non-static method from inside a static method?
Why is serialization required?
How to perform linear search in java?
If an application has multiple classes in it, is it okay to have a main method in more than one class?
Is 0 true or false?
What is high level language in computer?
what is object slice?
Can an object be null?
How do you override a private method in java?