我以前查过这个错误,但主要是有两个类声明的人。
我一直在寻找几个小时来寻找帮助,但我找不到任何东西!我对错误的唯一其他猜测是它与公共/私有属性有关。但这只是猜测!
所以我不确定我的代码有什么问题导致这种情况,代码是:
class Node
{
//Variables
private String id;
private PVector position;
private Float radius;
private int headerHeight;
private String headerText;
//Needs var holding node links!!
//Constructor
public Node(String _id, int _x, int _y, Float _radius)
{
id = _id;
position = new PVector(_x, _y);
radius = _radius;
headerHeight = 20;
headerText = "";
}
//Getters and Setters
public String getID()
{
return id;
}
public void setID(String _id)
{
id = _id;
}
public PVector getPosition()
{
return position;
}
public void setPosition(PVector _position)
{
position = _position;
}
public Float getRadius()
{
return radius;
}
public void setRadius(Float _radius)
{
radius = _radius;
}
public int getHeaderHeight()
{
return headerHeight;
}
public void setHeaderHeight(int _height)
{
headerHeight = _height;
}
public String getHeaderText()
{
return headerText;
}
public void setHeaderText(String _headerText)
{
headerText = _headerText;
}
}