class or interface expected

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • sara meecan
    New Member
    • Mar 2012
    • 1

    class or interface expected

    I am writing a java program on putty

    i have my p.java class as follows

    /** comments

    */
    public enum p{yes,no};

    and this tells me i need a class or an interface and im so confused as to what is happening?
    When i compile of putty with javac *.java it comes up with errors.

    Could it be that its not the latest java compiler? If so i have a makefile so how do i add it to it?

    Please help me with this, i have been trying this the entire night.
  • limweizhong
    New Member
    • Dec 2006
    • 62

    #2
    What are you trying to accomplish? You need to figure that out before you try compiling a program. I can't really help after that as I don't know Java, but I know C++ and your piece of code looks like it accomplishes nothing.

    Comment

    • r035198x
      MVP
      • Sep 2006
      • 13225

      #3
      If you want to make it public then it must be in it's own file that matches the name of the enum. Also, you should be using Java 5 or newer for you to be able to use enums.

      Comment

      • neeraj0708
        New Member
        • Feb 2012
        • 21

        #4
        can you share your code here...!

        Comment

        Working...