class, interface, or enum expected

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

[code]public class PFChar_Base {

public static String cName;

public PFChar_Base(String name){
cName = name;



  • "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.
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


In this Discussion