This week's book giveaway is in the Agile and Other Processes forum.
We're giving away four copies of The Little Book of Impediments (e-book only) and have Tom Perry on-line!
See this thread for details.
Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

EL . and [] operator doubt

 
Joshua Antony
Ranch Hand
Posts: 254
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
say a is a map in some scope:
then ${a.b} and ${a} will [B]not produce the same result because in case of ${a.b}, b is directly searched and in case of ${a[b]} the value contained in the variable b is searched in the map, is this true?
 
Aditya Singh
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
in Case ${a.b} value seached as a.containsKey("b");
in Case ${a[b]} value b in searched in all scopes if its found, then using that value a.containsKey(val) is called, if its not found then null will be returned.
 
Joshua Antony
Ranch Hand
Posts: 254
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks, got the point
 
Ashok Kumar Babu
Ranch Hand
Posts: 129
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
b is directly searched and in case of ${a[b]} the value contained in the variable b is searched in the map, is this true?


Your Statement is true.

{a.b} equal to {a['b']} equal to {a["b"]}
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic