Open In App

POJI in Java

Improve
Improve
Like Article
Like
Save
Share
Report

POJI: stands for Plain Old Java Interface. A POJI is an ordinary interface without any specialties. The interfaces that do not extend from technology/framework specific interfaces. For example all user defined interfaces are POJI and an interface that inherits from AppletInitializer of Java Beans is not POJI.
Examples:

JAVA




// A POJI interface
interface GFG {
  public void method1();
}
 
interface Geeks extends GFG {
  public void method2();
}


Explanation: Here both the interfaces i.e. GFG and Geeks are POJI in nature. Because both GFG and Geeks does not extends from any technology specific interface.
  
 
 

JAVA




// Another POJI interface
interface GFG extends java.io.Serializable {
 
}


Explanation: Here GFG is also a POJI. Here the interface is extending from Serializable interface but that serializable interface is not the part of any Technology, it is about Java API. Therefore, we can say that GFG is POJI in nature.
  
 
 

JAVA




// Not a POJI Interface
interface GFG1 extends java.rmi.Remote {
 
}
 
// Not a POJI Interface
interface GFG2 extends java.beans.AppletInitializer {
 
}


Explanation: Here GFG1 and GFG2 are not POJI in nature. Because Remote and AppletInitializer not part of API, it is technology.
 



Last Updated : 05 May, 2021
Like Article
Save Article
Previous
Next
Share your thoughts in the comments
Similar Reads