+1 vote
in JAVA by
What is the nested interface?

1 Answer

0 votes
by
An Interface that is declared inside the interface or class is known as the nested interface. It is static by default. The nested interfaces are used to group related interfaces so that they can be easy to maintain. The external interface or class must refer to the nested interface. It can't be accessed directly. The nested interface must be public if it is declared inside the interface but it can have any access modifier if declared within the class. The syntax of the nested interface is given as follows.

interface interface_name{    

 ...    

 interface nested_interface_name{    

  ...    

 }    

}

Related questions

0 votes
asked May 2, 2021 in JAVA by sharadyadav1986
0 votes
asked Apr 13, 2023 in JAVA by Robin
...