4. Object Structures, Aliasing, and Encapsulation
4. Object Structures, Aliasing, and Encapsulation
4. Object Structures, Aliasing, and Encapsulation
You also want an ePaper? Increase the reach of your titles
YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.
Leaking:• Leaking occurs when data structure passes areference to an object which is supposed to beinternal to the outside• Leaking often happens by mistake.• Problem: Alias can be used to by-pass interfaceof data structure.list1array:next:arrayclass ArrayList {private int[ ] array;private int next;public int[ ] getElems( ){ return array; }…}13.05.13© A. Poetzsch-Heffter, TU Kaiserslautern10