OO Question...

If the class BER_InventJournal_Transfer extends BER_InventJournal

----------DECLARATION------------

BER_InventJournal InventJournal ;

BER_InventJournal_Transfer InventJournal2 ;


Do the OBJECTS InventJournal and InventJournal2 will be the same if one of the declaration is on parent class.

InventJournal = new BER_InventJournal_Transfer(BER_JournalParameters);

InventJournal2= new BER_InventJournal_Transfer(BER_JournalParameters);

Thanks

Yes and no.

Yes: Objects are created by constructors. What type of variable stores the memory address of the object doesn’t have impact to the object itself.

No: You’re calling two constructors, therefore you’re creating two different instances (containing the same data).