File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Beginning Java and the fly likes class or interface expected? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "class or interface expected?" Watch "class or interface expected?" New topic
Author

class or interface expected?

Brandi Love
Ranch Hand

Joined: Sep 19, 2003
Posts: 133
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\PopEstimate.java:71: 'class' or 'interface' expected
}
^
C:\My Documents\PopEstimate.java:73: 'class' or 'interface' expected
^
2 errors
Ernest Friedman-Hill
author and iconoclast
Marshal

Joined: Jul 08, 2003
Posts: 24166
    
  30

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!


[Jess in Action][AskingGoodQuestions]
 
 
subject: class or interface expected?
 
Similar Threads
String concatenation
Program Error,Thanks
Population and Growth Rate Problem
what should i know about Strings in the 1.4 exam
Future Value Calculator