An interface can have another interface which is known as a nested interface.
Example of nested interface which is declared within the interface
Output:
Let's see how we can define an interface inside the class and how we can access it. Below program is the example for nested interface which is declared within the class.
Output: