Message1052
Consider the the following 3 java classes.
// ---- A.java ----
package x;
// package private class
class A {
public void f() {
System.out.println("f");
}
}
// ---- B.java ----
package x;
// public class extending from a package private class
public class B extends A {
public void g() {
System.out.println("g");
}
}
// ---- C.java ----
import x.*;
public class C {
public static void main(String[] args) {
B.g();
B.f();
}
}
The class C compiles without errors and runs without any
problems. But it does not work in jython.
>>> from x import B
>>> dir(B)
['g']
>>> b = B()
>>> b.g()
g
>>> b.f()
Traceback (innermost last):
File "<console>", line 1, in ?
AttributeError: 'javainstance' object has no attribute 'f'
# but there are available in java.
>>> for m in B.getMethods(): print m.getName()
g
f
hashCode
getClass
wait
wait
wait
equals
notify
notifyAll
toString
|
|
Date |
User |
Action |
Args |
2008-02-20 17:17:26 | admin | link | issue1331437 messages |
2008-02-20 17:17:26 | admin | create | |
|