Java error handling: nested type (Node) cannot hide private type

I searched for this error before, but basically these are just people who have two class declarations.

I searched for several hours to find some help, but I can not find anything! My only guess about what is wrong is that this is due to public / private attributes. But this is just an assumption!

So, I'm not sure what is wrong with my code to call this, the code:

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; } } 
+4
source share
1 answer

Check if your tab or thumbnail matches the name of the inner class of the program. Change the name of your tab / thumbnail and everything will be fine.


Rename your sketch ( foo.pde ), which is also the name of the tab. for something other than a class name. The main sketch in processing cannot have a nested class with the same name, other sketches (other tabs) can have classes with the same name as the tab.

+3
source

Source: https://habr.com/ru/post/1488847/


All Articles