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.
Printable View
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.
It seems that you try to use the reserved keyword class as an identifier. Try naming your variable something other than class.
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.