Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
The moose likes Beginning Java and the fly likes Searching and displaying results in a multi-dimensional array. Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Beginning Java
Reply locked New topic
Author

Searching and displaying results in a multi-dimensional array.

Scotty Steven
Ranch Hand

Joined: Jan 27, 2012
Posts: 67
I'm working on a two column array search utility, but I'm stuck on a couple of matters.

1. I want to insure that the utility only searches the first column of the array and ignores the second.
2. When it does find the word in the first column, I want it to display the second column on line 109.

I've got the majority of it written, but like I said, I'm stuck. Help is always appreciated.


Jeff Verdegan
Bartender

Joined: Jan 03, 2004
Posts: 5888
    
    6

Scotty Steven wrote:I'm working on a two column array search utility, but I'm stuck on a couple of matters.

1. I want to insure that the utility only searches the first column of the array and ignores the second.


What problem are you having with that? Just look in arr[x][0], and not in arr[x][1].

2. When it does find the word in the first column, I want it to display the second column on line 109.


So display arr[x][1].

Scotty Steven
Ranch Hand

Joined: Jan 27, 2012
Posts: 67
Ya, that was stupid simple.

Thanks!
Mohamed Sanaulla
Bartender

Joined: Sep 08, 2007
Posts: 2928
    
  15

Scotty Steven wrote:Ya, that was stupid simple.

Thanks!


In future please CarefullyChooseOneForum
Similar discussion here, locking this one.


Mohamed Sanaulla | My Blog
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Searching and displaying results in a multi-dimensional array.
 
Similar Threads
Searching and displaying results in a multi-dimensional array.
Help correcting a button behavior in swing
Traps to be aware of in any SCJP test !!!!! :)
urgent help! my while loop is not working
Sun Academic Initiative offer of a FREE SCJA Beta Certification Exam