Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Compound Investment  RSS feed

 
Konrad Cetes
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

I'm trying to create a program that calculates compound investment. It keeps popping up with errors.



Error51, 1) java: class, interface, or enum expected
 
Carey Brown
Bartender
Posts: 2980
46
Eclipse IDE Firefox Browser Java MySQL Database VI Editor Windows
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Line 46 is an extra closing brace. You have clean indentation in your code so that should have been apparent.
 
Campbell Ritchie
Marshal
Posts: 55678
161
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you get class interface or enum expected at the beginning of the file, you have spelt something wrong, e.g. Public class Foo instead of public class Foo.
If that error occurs at the end of the file you have got too many }s.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!