【发布时间】:2014-11-02 16:51:03
【问题描述】:
我正在尝试将一个类点的对象创建到另一个类 InterestPoint 中,有些话我希望能够在我的 INterestPoint 类中使用 Points 值但不使用遗传
public class InterestPoint {
private Point p1;
private String aeria;
public InterestPoint() {
this.p1 = new Point();
//p1.dysplay1();
}
}
编辑
不,当我调用我的方法通过类函数打印我的观点时,你误解了它会打印一个错误,上面写着:
Exception in thread "main" java.lang.UnsupportedOperationException: Not supported yet.
at Point.dysplay1(Point.java:29)
at InterestPoint.setall1(InterestPoint.java:22)
at Main.main(Main.java:16)
Java Result: 1
这就是我发布这个问题的原因:D
【问题讨论】:
-
你的问题是?
-
你卡在哪里了?你怎么卡住了?你可以像你正在做的那样使用组合,并为 p1 提供一个 getter 方法。请注意,我试图修复您的代码格式。将来,您将希望自己为您在此处发布的任何代码执行此操作。