This code throws the error
"Constant expression required" ponting to "INTEGER_CLASS_STRING".
It is a final variable, although it is a constant. Why do I get this error?
My code below:
private static final String INTEGER_CLASS_STRING = Integer.class.toString();
private static final String DOUBLE_CLASS_STRING = Double.class.toString();
switch (definition.get(correctKey).getClass().toString()){
case INTEGER_CLASS_STRING: System.out.println();
case DOUBLE_CLASS_STRING: System.out.println();
}