This week's book giveaway is in the HTML Pages with CSS and JavaScript forum.
We're giving away four copies of Testing JavaScript Applications and have Lucas da Costa on-line!
See this thread for details.
Win a copy of Testing JavaScript Applications this week in the HTML Pages with CSS and JavaScript 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
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

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
 
We cannot change unless we survive, but we will not survive unless we change. Evolving tiny ad:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
    Bookmark Topic Watch Topic
  • New Topic