This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes printing the values of an array Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "printing the values of an array" Watch "printing the values of an array" New topic
Author

printing the values of an array

Savanna Ray
Greenhorn

Joined: Nov 20, 2004
Posts: 9
Hello!

I have almost finished making this code work. It's supposed to print out the name/value pairs of a query string (eg.from a form URL query string).
I've got it to print out the 'name' part of the pair array, but can't seem to print out the 'value' part.

Here's the code:



I changed the print method, in util class, to take a String name as well, but it didn't compile. Any suggestions on how to print the last half of the array?

Thanks so much...
Almost finished
Savanna Ray
Greenhorn

Joined: Nov 20, 2004
Posts: 9
I thought it would be able to access the form class from the print method, but compiling says it can't find symbol variable form.
Maybe I should be invoking the method getValue differently?
Rick Portugal
Ranch Hand

Joined: Dec 17, 2002
Posts: 243
I'm not completely sure what you're trying to accomlish. It seems that this code could be simplified. But take a look at this and let me know if this helps:

I made the getValues() method just like the getNames() method. I also changed the Util.print() method to accept two arrays of Strings. I'm puzzled as to why the Util.print method uses arrays called array and name. I would have expected something like "name" and "value".

Hope that helps.


IBM 286, SCJP, SCWCD, EIEIO
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: printing the values of an array
 
Similar Threads
java.net.SocketTimeoutException: Receive timed out
List boxes
Incrementor operator
Question Mock
re: trying to display a list of arrays