Home  |   STIU  |   WOW  |   SCJP  |   SCDJWS   |   JEE FAQ  |   About US  |  

FAQ
  Java FAQ
  JSP FAQ
  Servlet FAQ
 

Advertisement

XyzWs Java FAQ:
How to access inner class in an interface?


Printer-friendly version Printer-friendly version | Send this 
article to a friend Mail this to a friend


Previous Next vertical dots separating previous/next from contents/index/pdf Contents
Advertisement
How to access inner class in an interface?

How to access inner class in an interface?


An inner class always behaves like a data variable of its encoding class or interface. By default all variables which are declared in an interface are final and static. A class defined inside an interface is implicitly static.

interface InterfaceXYZ {
  class InnerXYZ {
  }
}
class Program {
   public static void main(String[] args) {
       InterfaceXYZ.InnerXYZ  inner = new InterfaceXYZ.InnerXYZ();
   }
}

 


Previous Next vertical dots separating previous/next from contents/index/pdf Contents

Support  | Feedback  | Help