aspose file tools
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes Assignment of an Array to a key Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Reply Bookmark "Assignment of an Array to a key" Watch "Assignment of an Array to a key" New topic
Author

Assignment of an Array to a key

Padma priya Gururajan
Ranch Hand

Joined: Oct 05, 2006
Posts: 411
Hi,
Please look at the following code:
String[] favoriteMusic = { "Zero7","BT","Frou Frou"};
request.setAttribute("musicList","favoriteMusic");



Is it correct to assign a string array to a key called "musicList".


With regards,
Padma priya N.G.


Padma priya N.G.
Be the change you want to be - Mahatma Gandhi
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14669
    
  11

You've got extra double quotations. It should be :


Yes it's ok, because as you know, arrays behave like any objects.


[My Blog]
All roads lead to JavaRanch
Padma priya Gururajan
Ranch Hand

Joined: Oct 05, 2006
Posts: 411
Hi,
Thanks.
Padma priya N.G.
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: Assignment of an Array to a key
 
Similar Threads
Unable to display arrays in JSP
EL and quotes (HFSJ pg373)
Unable to display the content in array(created in the servlet)using JSP!
HFSJ EL e.g. page 371
Unable to understand the solution on EL