aspose file tools *
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes Question on getParameterNames and getParamaterValues return types 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 "Question on getParameterNames and getParamaterValues return types" Watch "Question on getParameterNames and getParamaterValues return types" New topic
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
Sheriff

Joined: Aug 03, 2008
Posts: 9323
    
  17

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
ExamLab Creator
Saloon Keeper

Joined: Jul 29, 2008
Posts: 3283
    
  55

Have a look at the javadoc for java.util.Enumeration - You may get the idea.


Author of ExamLab ExamLab - a free SCJP / OCPJP exam simulator
What would SCJP exam questions look like? -- Home -- Twitter -- 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?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Question on getParameterNames and getParamaterValues return types