Answer Posted / manish kushwaha
Hi All,
As we all know java is not complete OOps language the reason
behind this is java does not support multiple inheritance,
to avoid this draw back of java sun introduce interface
alomg with few new concept.
So 110% sure that we can implements and we can extends as
well more than one interface.
Scenarios:
1) in term of subclass
interface i1{
void mi1();
}
interface i2{
void mi2();
}
now
Case 1:
public class MultipleImplements implements i1,i2{
// now here we need t implement all methods available in i1
and i2 (restricted)
public void mi1(){
System.out.println("Interface i1 mthod");
}
public void mi2(){
System.out.println("Interface i2 mthod");
}
}
Case 2:
interface i3 extends i1,i2{
// here use can define more method and you can not over ride
i1 and i2 method because you can not method body in interface so
String mi3();
}
Conclusion: 110% you can extend and implement more than one
interface
Is This Answer Correct ? | 4 Yes | 2 No |
Post New Answer View All Answers
What is double in java?
What is integer size in java?
How to sort numbers in java without array?
Will set allow duplicates in java?
What is :: operator in java 8?
What is byte code and why is it important to java’s use for internet programming?
What is the use of singleton class?
What is the difference between double and float variables in java?
Explain some best practices you would apply while using collection in java?
What is difference between next () and nextline () in java?
Why spring singleton is not thread safe?
When a thread is executing synchronized methods , then is it possible to execute other synchronized methods simultaneously by other threads?
What is the primary benefit of encapsulation?
What is scope & storage allocation of static, local and register variables? Explain with an example.
Can we override constructor?