13.07.2015 Views

4. Object Structures, Aliasing, and Encapsulation

4. Object Structures, Aliasing, and Encapsulation

4. Object Structures, Aliasing, and Encapsulation

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Scenarios in which references are exported (1-6):package inside;public class C extends outside.B {public void putReferences() {C c = new C();/*1*/ outside.B.c1 = c;/*2*/ outside.B.storeReference(c);/*3*/ outside.B.c3s = new C[]{c};/*4*/ calledByConfined();/*5*/ implementedInSubclass();/*6*/ throw new E();}public void implementedInSubclass(){}/*7*/ public static C f = new C();/*8*/ public static C m(){ return new C();}/*9*/ public static C[] fs= new C[]{new C()};/*10*/ public C() { }}public class E extends RuntimeException{}13.05.13© A. Poetzsch-Heffter, TU Kaiserslautern34

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!