• Post Reply Bookmark Topic Watch Topic
  • New Topic

Nested type HelloNode hides an enclosing type  RSS feed

 
Atrus Greyor
Ranch Hand
Posts: 110
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm stuck with an error that I've never seen, nor can figure out why it's there. I searched on Google, but I came up with nothing. Its giving me the error on "public class HelloNode extends SimpleGame". Whats also strange is I have another class with nearly the exact same code (just diffent name and imports) and I don't get this error.

Code as follows:

 
Ernest Friedman-Hill
author and iconoclast
Sheriff
Posts: 24217
38
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, if that's your real code, then it's not going to compile regardless of class names: of the three lines inside the nested class, only the first is legal; the second two are statements, which can't appear at class scope -- only inside blocks and methods. Perhaps this is what causes the odd error message.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!