| 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
|
|
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.
|
 |
 |
|
|
subject: Assignment of an Array to a key
|
|
|