From: <ma...@la...> - 2001-06-18 20:35:28
|
I was trying out a simplistic example that I /thought/ was something I'd done before, but I can't get it to work. Assuming a piece of Java that looks like this: public class A { public A() { System.out.println("new A"); } private void mA() { System.out.println("A's method"); } public class B { public B() { System.out.println("new B"); } private void mB() { System.out.println("B's method"); } public class C { public C() { System.out.println("new C"); } public void mC() { System.out.println("C's method"); mA(); mB(); } } } } How do I do, in Jython, the equivalent of this code: public class Foo { public static void main(String[] args) { A a = new A(); // a.mA(); // private mA: can't reach from here A.B b = a.new B(); // b.mB(); // private mB: can't reach from here A.B.C c = b.new C(); c.mC(); // public mC should have access to mA and mB } } My efforts at this are running into all kinds of visibility problems - instantiating an "A" is fine, but beyond that I'm not getting what I want. Feeling el-stupido, Mats |