This week's book giveaway is in the General Computing forum.
We're giving away four copies of Learning Regular Expressions and have Ben Forta on-line!
See this thread for details.
Win a copy of Learning Regular Expressions this week in the General Computing forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
  • Devaka Cooray
  • Jeanne Boyarsky
  • Knute Snortum
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Ganesh Patekar
  • Stephan van Hulst
  • Pete Letkeman
  • Carey Brown
  • Tim Holloway
  • Ron McLeod
  • Vijitha Kumara

Error: constant expression required  RSS feed

Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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:

but none of them work compiletime in JBuilder 2005
Does anyone have a clue why?

Maya Pedersen
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!