Win a copy of Learn Spring Security (video course) this week in the Spring forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Getting "Class, Interface or Enum expected" at the end of my code.

 
Toshiro Hitsuguya
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey, you guys have been extremely helpful so far.

I am having a problem getting part of my code to compile. At the very end of the code I am getting "Class, Interface, or Enum expected" at the end of my code. I tried to add another } but that didn't work. I have part of my code finished so far.




 
Toshiro Hitsuguya
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Never mind just fixed it.
 
Campbell Ritchie
Sheriff
Posts: 48363
56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well done fixing it ( ) ; I probably know what you did without even looking at your code, but for the benefit of other readers, please tell us briefly what the problem was.
 
Toshiro Hitsuguya
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sure. Thanks. It's very simple. I went through the number of } and found that I had too many. Simple error. Erased one and worked fine.
 
Campbell Ritchie
Sheriff
Posts: 48363
56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That's what I though. "class interface or enum expected" at the end of the class means too many }
The same error at the beginning of the class usually means
  • A spelling error eg Class or clas
  • Something other than package declarations or imports before the class declaration
  • A formatting error like publicclass instead of public class
  •  
    • Post Reply
    • Bookmark Topic Watch Topic
    • New Topic