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 | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
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: 430
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: 14687
    
  16

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: 430
Hi,
Thanks.
Padma priya N.G.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Assignment of an Array to a key
 
Similar Threads
Unable to understand the solution on EL
Unable to display arrays in JSP
Unable to display the content in array(created in the servlet)using JSP!
HFSJ EL e.g. page 371
EL and quotes (HFSJ pg373)