Win a copy of Java Concurrency Live Lessons this week in the Threads forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Literal Constant  RSS feed

 
Arun Thakur
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a if loop in jsp file:

if (page == 41)
{
-----
}

JTEST is showing me coding error that Literal constant canot be used.

I tried to intilialize
private static final int CONST41 = 41
and if (page == CONST41)
{
}

still its showing me same error at declaration of CONST41

WHAT TO DO???
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65833
134
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It's perfectly legal, though bad form, to use a constant in that manner. Perhaps you should check with JTEST documentation to see why it is complaining.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!