*
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 | Flagged Topics | Hot Topics | Zero Replies
Register / Login
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: 80
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: 6109
    
    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: 80
Ya, that was stupid simple.

Thanks!
Mohamed Sanaulla
Saloon Keeper

Joined: Sep 08, 2007
Posts: 3064
    
  33

Scotty Steven wrote:Ya, that was stupid simple.

Thanks!


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


Mohamed Sanaulla | My Blog
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Searching and displaying results in a multi-dimensional array.
 
Similar Threads
Traps to be aware of in any SCJP test !!!!! :)
Help correcting a button behavior in swing
Searching and displaying results in a multi-dimensional array.
Sun Academic Initiative offer of a FREE SCJA Beta Certification Exam
urgent help! my while loop is not working