|
-
July 1st, 2007, 10:40 AM
#1
Error in line of code
I have created a class which has this line of code :
private Class class;
But an error message pops up saying:
identifier expected and both Class and class are highlighted.
Why is this and how do I resolve them.
-
July 1st, 2007, 11:00 AM
#2
Re: Error in line of code
It seems that you try to use the reserved keyword class as an identifier. Try naming your variable something other than class.
-
July 1st, 2007, 11:35 AM
#3
Re: Error in line of code
As wildfrog says, your variable has been given a name which is a reserved word in java.
Basically, you can't call your class 'class', just like you couldn't call an int 'int', 'return', 'double' or any other reserved word.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|