Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
Win a copy of Java Mock Exams (software) this week in the Programmer Certification (OCPJP) forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Constants in Classic Tag

 
Shivani Chandna
Ranch Hand
Posts: 380
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Read this in a post related to Constants returned from Class Tag methods..


public static final int EVAL_BODY_AGAIN = 2
public static final int EVAL_BODY_BUFFERED = 2

both are having value 2 so practically doStartTag can return EVAL_BODY_AGAIN


My Ques.
Are we supposed to know what is the integer value for each of the constants returned = such that if two constants have same value these can be interchanged??? . If so, can someone list all the constant and their mapped integer values over here...

Regards,
Shivani.
 
Narendra Dhande
Ranch Hand
Posts: 951
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I think though the integer values of the constants are same, they are used the return value of the different methods.

The doStartTag can return the EVAL_BODY_BUFFERED and the doAfterBody can return the EVAL_BODY_AGAIN. So, no problem of same values. I think the constants have given to descriptive names to identify the purpose. As these are compile time constants, you can use the direct value, instead of these constants.

For the Exam You do not have to know the value of these constants.

Thanks
[ August 24, 2006: Message edited by: Narendra Dhande ]
 
What are you doing? You are supposed to be reading this tiny ad!
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!