| Author |
Error: constant expression required
|
maya pedersen
Greenhorn
Joined: May 27, 2004
Posts: 6
|
|
Hi, I'm having problems switching on my public static final ints The code above is called from class MeterReportManager that extends ReportUtils, which is a public abstract class. The constants (FORMAT_HTML etc) are members of ReportUtils. I've tried to do the case like: case ReportUtils.FORMAT_PDF: case MeterReportManager.FORMAT_PDF: case FORMAT_PDF: but none of them work compiletime in JBuilder 2005 Does anyone have a clue why? Sincerely, Maya Pedersen
|
live long and prosper
|
 |
Jfriend lavanya
Greenhorn
Joined: Mar 23, 2005
Posts: 2
|
|
hi always the expression near case expect constant value. but no problem for using final variables. i worked out a program similar that of yours. its working fine. try to print the value of the final variables after commenting switch and check their values
|
 |
 |
|
|
subject: Error: constant expression required
|
|
|