错误:即使符号是公共变量也找不到符号?

时间:2020-09-10 19:04:14

标签: java

我遇到了很多错误,例如下面的错误,我很困惑为什么要确保不直接访问所述私有变量

{ coinData.image && <img src={coinData.image.small} alt="Bitcoin logo"></img> }

这是声明未找到符号的相关类

symbol:   method GetP()
location: class LineSegment
FastCollinearPoints.java:47: error: cannot find symbol
           Point big = nonFinishedSegments.get(i).GetQ()

这是其他脚本中发现错误的部分(所有GetQ和GetP都会绘制错误)

public class LineSegment {
    private Point p;   // one endpoint of this line segment
    private Point q;   // the other endpoint of this line segment

    public Point GetQ(){
        return this.q;
    }
    public Point GetP(){
        return this.p;
    }


    public LineSegment(Point p, Point q) {
        if (p == null || q == null) {
            throw new NullPointerException("argument is null");
        }
        this.p = p;
        this.q = q;
    }

0 个答案:

没有答案