I see, I almost made a fatal mistake because my app breaks one of the fundamental OOP.
Then, what if I did something like below:
1) I created an interface that
extends the DB interface. Let's call it DB2. So "interface DB2 extends DB {...}".
2) DB2 contains the declaration for method "getAllRecords()", and methods already declared in interface DB.
3) Class Data implements
both DB and DB2, therefore class Data must implement methods from both interfaces.
4) Then, it would be DB2 db = new DB2();
Would it be acceptable from either the OOP & the spec's point of view?
For me, at least it doesn't break the rule that class Data must implement interface DB.
Thanks a lot for correcting my mistake & Thanks in advance for your help