Win a copy of Java Mock Exams (software) this week in the Programmer Certification (OCPJP) forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Doubt in a tag handler question

Mani Jagathesan
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

In one of the mock exams, I had this question.

Consider the following description of a tag in a TLD:

<description>Replaces emotions such as , , and with images. /description>

Which of the following statements regarding the above tag are correct?

Select 2 correct options.

a. It is an empty tag.
b. It may be used as an empty tag. < -- Correct
c. It must have a body.
d. It must implement BodyTag interface. < -- Correct
Explanation:Since the body-content is tagdependent, it must implement the BodyTag interface.
e. It may take an attribute named 'name'. But if present, its value must be dynamic.

My doubt: SimpleTags can also have <body-content> of tagdependent. I thought the only way we could tell what interface it implements is by actually looking at the class.

I thought, the second answer option for this question will be option C as tagdependent treats body-content as plain text.

Can the experts help me out please?


Happiness is not a goal ... it's a by-product of a life well lived - Eleanor Roosevelt. Tiny ad:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!