• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Doubt on Q 3 HFSJ chapter 10

 
Ranch Hand
Posts: 56
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi
For Q 3 in chapter 10 (page 560), I feel that none of the answers are right

Question
<my:tag1>
<my:tag2>
<my:tag3/>
<my:tag2>
<my:tag1>

where tag1 - extends TagSupport
tag2 - extends SimpleTagSupport
tag3 - extends TagSupport

Now the answer for this question is given as Option C ,
which says

"Tag3 Handler may use the getParent method twice to gain access to the
instance of Tag1 Handler"

But Tag3 is a classic Tag whereas Tag2 is a Simple Tag. So our call to
getParent fails here itself , coz a classic Tag's getParent() returns a "Tag" interface , which is not implemented by a SimpleTag.

When the call fails here, how can we use getParent() twice to access Tag 1

Can anyone explain me why this option is specified as correct one ? :roll:
 
Ranch Hand
Posts: 1026
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes that question doesn't have any correct answer.

Check the Errata
 
muthu kumaran
Ranch Hand
Posts: 56
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
oh..thanks vishnu
 
You guys haven't done this much, have ya? I suggest you study this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic