Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Can an interface extend multiple interfaces in Java?\\n
Yes, we can do it. An interface can extend multiple interfaces in Java.
Example:
interface A {
public void test();
public void test1();
}
interface B {
public void test();
public void test2();
}
interface C extends A,B {
public void test3();
}
class D implements C {
public void test() {
System.out.println("Testing
");
}
public void test1() {
System.out.println("Testing1
");
}
public void test2() {
System.out.println("Testing2
");
}
public void test3() {
System.out.println("Testing3");
}
}
public class Main {
public static void main(String[] args) {
D d=new D();
d.test();
d.test1();
d.test2();
d.test3();
}
}
Output:
Testing Testing1 Testing2 Testing3
Advertisements