假设我有课
public class Point extends Point2D.Double{ // Point2D is of course from sdk
public void myMethod(){}
//some actions
}
问题是,当我将此代码作为库从.jar文件包含到我的另一个项目时,我只能访问myMethod()而不能访问Point2D.Double类中的任何字段和方法。
举例:
import com.mylibrary.Point
public class SomeClass{
public SomeClass(){
Point myPoint = new Point(1,2);
myPoint.myMethod(); // ok
myPoint.getX(); // not ok althought there is getX() method in Point2D.Double class
}
}
如何才能访问这两个已编译的代码?