Last week, we had the author of TDD for a Shopping Website LiveProject. Friday at 11am Ranch time, Steven Solomon will be hosting a live TDD session just for us. See for the agenda and registration link
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
  • Piet Souris
  • Himai Minh

class or interface expected?

Ranch Hand
Posts: 133
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I keep getting these errors for a program I wrote, not sure how to fix them. I've looked over the program numerous times and it looks okay to me. Anyone have any idea how I can fix them so I can compile? I included the program and the error messages below.
(if ya want to know what the program is supposed to do, the problem is included in the program.)

errors: C:\My Documents\ 'class' or 'interface' expected
C:\My Documents\ 'class' or 'interface' expected
2 errors
author and iconoclast
Posts: 24204
Mac OS X Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Did you look at around line 71? Looks to me like you've got an extra closing brace at the end of the file. The error message means that whereas the only legal code at that point would be "class" or "interface", the compiler saw "}".
A real programmer's editor would have told you about this right away -- are you just editing code in Notepad or something? Using better tools can make you life easier!
I have a knack for fixing things like this ... um ... sorry ... here is a consilitory tiny ad:
Free, earth friendly heat - from the CodeRanch trailboss
    Bookmark Topic Watch Topic
  • New Topic