![](/img/trans.png)
[英]"The nested type cannot hide an enclosing type" class - Java Processing
[英]Processing Java Error: The nested type (Node) cannot hide an enclosing type
我以前查過這個錯誤,但主要是只有兩個類聲明的人。
我一直在尋找一些幫助,但我找不到任何東西! 我對錯誤的另一個猜測是它與公共/私人屬性有關。 但那只是一個猜測!
所以我不確定我的代碼導致了什么問題,代碼是:
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;
}
}
檢查選項卡或草圖名稱是否與程序的內部類名相同。 更改選項卡/草圖的名稱,你會沒事的。
將草圖 ( foo.pde
)重命名為選項卡的名稱,而不是類名稱。 處理中的主草圖不能具有相同名稱的嵌套類,其他草圖(其他選項卡)可以具有與選項卡同名的類。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.