Please refer following two examples of Containment and Inheritance. From these two you will get the exact idea about the Containment and Inheritance. See below:
Inheritance:
Code:
// Inheritance
interface Entity1
{
public Object getData();
}
interface PersistedEntity1 extends Entity1
{
public PersistedEntityPK getPK();
// all other Entity methods inherited from super interface
}
Containment :
//
Containment:
interface Entity1
{
public Object getData();
}
interface PersistedEntity1
{
public PersistedEntityPK1 getPK1();
// must call getEntity() method to call any of Entity's members...
public Entity getEntity();
}
Bookmarks