From: Oti <oh...@ya...> - 2004-02-11 17:37:45
|
[ jai ] > I'm having a java file which will be like the given below > package newpack; > public class one > { > public class innerclass > { > public void fun() > { > } > } > } > > Now i want to access this inner class function using jython > i have given like this > #######jython file > import newpack.one > class jyclass: > def disp(self): > self.obj= newpack.one().innerclass() > obj.fun() Given in java: package test; public class Outer { public class Inner { public void innerMethod() { System.out.println("inner method"); } } } you can say in Jython: >>> from test import Outer >>> outer = Outer() >>> inner = Outer.Inner(outer) >>> inner.innerMethod() inner method or: >>> inner = outer.Inner(outer) >>> inner.innerMethod() inner method >>> Best wishes, Oti. |