- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- 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
- Related Articles
- Can an interface in Java extend multiple interfaces?
- Can we extend interfaces in Java? Explain?
- How to extend Interfaces in Java
- List the Interfaces that an Interface Extends in Java
- Can we extend an enum in Java?
- How to inherit multiple interfaces in Java?
- How we can extend multiple Python classes in inheritance?
- Can we declare an interface with in another interface in java?
- Multiple inheritance by Interface in Java
- Can Enum extend any class in java?
- Can interfaces have constructors in Java?
- Can Enum implements an interface in Java?\n
- How multiple inheritance is implemented using interfaces in Java?
- Can we create an object for an interface in java?
- Can interfaces have Static methods in Java?

Advertisements