By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,648 Members | 1,528 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,648 IT Pros & Developers. It's quick & easy.

class or interface expected

P: 1
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.
Mar 29 '12 #1
Share this Question
Share on Google+
3 Replies


P: 62
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.
Mar 29 '12 #2

10K+
P: 13,264
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.
Mar 29 '12 #3

P: 21
can you share your code here...!
Mar 29 '12 #4

Post your reply

Sign in to post your reply or Sign up for a free account.