Java

Moderators: zibadian
Number of threads: 7836
Number of posts: 18235

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
class, interface, or enum expected Posted by makeBrainHurt on 9 Jan 2012 at 11:10 AM
I've returned to Java after some absence and now trying to get myself ready to get the first in Oracle's series of Java certifications. As learning exercises I'm also building a portfolio.

I'm building a class and finished with the initialization. Now when I'm creating the class methods NetBeans is giving me red exclamation marks at the beginning, end, and return statement lines of the methods that say, "class, interface, or enum expected." What am I doing wrong? Thanks

public class PFChar_Base  {

    public static String cName;  
//...
}

public PFChar_Base(String name){
        cName = name;
        
    }

Report
Re: class, interface, or enum expected Posted by JavaIsFun on 18 Jan 2012 at 2:01 PM
"class, interface, or enum expected" usually means you have a syntax error..

Post your entire code and I bet you we can find it.

Hope that helps.



 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.