• 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

hfs chap-8 qno-7 doubt

 
Ranch Hand
Posts: 453
Google Web Toolkit Hibernate Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 9707
43
Android Google Web Toolkit Hibernate IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic