I have defined two classes for a java program I am writing, call them Class1 and Class2. In the body of the constructor for Class1, I call the constructor for class 2. Howev
This is an addition to the answer of Grease. (I can't add a comment due to lack of reputation.)
I sometimes run into the same issue and always deleted the complete folder, so NetBeans had to rebuild the maven-stuff which can take a few minutes.
If someone uses maven and don't want NetBeans has to completely rebuild the maven repos and -index, don't delete the following folders in the NetBeans cache folder:
Just tested it with NetBeans 11.3: Not deleting the three folders makes the error(s) go away but don't bothers maven. I could imagine that this is the same with older versions of NetBeans.