• Post Reply Bookmark Topic Watch Topic
  • New Topic

HFSJ page 380

 
Vivek Gupta
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
HFSJ page 380
Code magnets exercise:
What can be the different EL expressions which can be put to print the same result?

Leelu's dog Clyde's toys are: stick, neighbour's cat, and a Barbie doll head
My try-
${person["name"]}'s dog ${person["dog"].name}'s toys are: ${person["dog"].toys[0].name},${person["dog"].toys[1].name}, and a ${person["dog"].toys[2].name}

Can it be written by without using the dot (.) operator and "only using" the [] operator.
 
Gravity is a harsh mistress. But this tiny ad is pretty easy to deal with:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!