I have defined an enum. When I try to write:
private ENUM_NAME variableName;
as the instance variable of a class, the compiler tells me:
cannot find symbol - class ENUM_NAME
which is preventing me from continuing.
I am using the BlueJ IDE, if that matters. All files are contained within one package, and are in the same folder on my computer. I began with the enum inside of another class (a test driver for my working class), and I got the stated error in my working class. Then I tried making the enum its very own class, and I got the same error.
The test driver class:
public class BicycleMainClass
{
enum BICYCLE_TYPE_ENUM {STANDARD, RACER, MOUNTAIN, BMX};
//main method below
}
The "working" class:
public class BicycleClass
{
private BICYCLE_TYPE_ENUM bicycleType;
//this line gives me the error "cannot find symbol - class BICYCLE_TYPE_ENUM"
}
I would expect it to compile without error, because enums are a valid variable type. What am I not understanding?