Win a copy of AWS Security this week in the Cloud/Virtualization forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • salvin francis
  • fred rosenberger

hfs chap-8 qno-7 doubt

 
Ranch Hand
Posts: 453
Google Web Toolkit Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hello everybody

in the question one option is
${foo["5"] is valid syntax if foo is a Map
which is given correct.

i know that we can write an attribute name which doesn't follow the java rules for naming an identifier with double quotes inside [ ] while using EL i.e. will be valid

but can "5" be a key for a map ??? as it doesn't follow the java rules (can't start with a digit )
or am i missing some point here ??

avi sinha
 
Sheriff
Posts: 9671
42
Android Google Web Toolkit Hibernate IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well you can always put a "5" as a key in a map, "5" is after all a string, even you can have 5 as a key in a map as the compiler will autobox it into Integer. A key in the map needs to be an object whether String "5" or Integer 5 or anything else...
 
avi sinha
Ranch Hand
Posts: 453
Google Web Toolkit Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
oops what was i doing ???

well i think i need a break.actually my exams are going on and a lot of cryptography , industrial management , distributed computing .... they are just playing cricket inside my mind.
unable to think properly
anyways thanks alot ankit

avi sinha
 
It's just like a fortune cookie, but instead of a cookie, it's pie. And we'll call it ... tiny ad:
Devious Experiments for a Truly Passive Greenhouse!
https://www.kickstarter.com/projects/paulwheaton/greenhouse-1
    Bookmark Topic Watch Topic
  • New Topic