• Post Reply Bookmark Topic Watch Topic
  • New Topic

A EL Question

 
karmot ditt
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello all,

Anyone out there know the correct answer for the follow question (I have modify it a litte bit from Enthuware QID:1077419390651):

<%
request.setAttribute(�names�, new String[]{�1�,�2�,�3"});
request.setAttribute(�index�,�2�);
%>
<h1><% -- insert code here --%><h1>
Which of the following statements will print "3" in inserted in the above JSP page?

Select 3 correct options
a. ${names.2 }
b. ${names [�2�]}
c. ${names.index }
d. ${names[index]}
e. ${names} [index]
f. ${names.(names.index)}
g. ${names[names[index-1]]}

Thanks,
KD.
 
Sanjay pts
Ranch Hand
Posts: 357
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
b,d
 
Sushma Sharma
Ranch Hand
Posts: 139
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
even ${names[names[index-1]]} will print 3...
 
shiva viswanathan
Ranch Hand
Posts: 152
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi ,

Yes thats right the consolidated answers should be b,d,g
 
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!