| Author |
Question on getParameterNames and getParamaterValues return types
|
Lorenz Baylon
Ranch Hand
Joined: Jan 04, 2006
Posts: 99
|
|
|
Does anyone know why getParameterNames returns Enumeration type while getParameterValues returns a String array? Is it possible that getParameterNames will return a collection of non-String values? Thanks.
|
I just cant look, its killing me.
|
 |
Ankit Garg
Saloon Keeper
Joined: Aug 03, 2008
Posts: 9189
|
|
|
Think about it, parameter names comes as a part of HTTP request, which is plain text, then how can getParameterNames return something which is not String...
|
SCJP 6 | SCWCD 5 | Javaranch SCJP FAQ | SCWCD Links
|
 |
Lorenz Baylon
Ranch Hand
Joined: Jan 04, 2006
Posts: 99
|
|
|
Thanks Ankit, given that fact, then why does the getParameterNames return an Enumeration instead an array of Strings?
|
 |
Devaka Cooray
Saloon Keeper
Joined: Jul 29, 2008
Posts: 2691
|
|
Have a look at the javadoc for java.util.Enumeration - You may get the idea.
|
Author of ExamLab (Download) - the free mock exam kit for SCJP / OCPJP
Home Page -- Twitter Profile -- JavaRanch FAQ -- How to Ask a Question
|
 |
Lorenz Baylon
Ranch Hand
Joined: Jan 04, 2006
Posts: 99
|
|
Thanks Devaka. Im not really sure if im getting it, but can't the getParameterValues method also return an Enumeration rather than a String array, with the same reason that the getParamaterValues method returns one?
|
 |
 |
|
|
subject: Question on getParameterNames and getParamaterValues return types
|
|
|