title: Arrays: Find array[x][1] for different x
body: <p>First off let me tell you that English is not my native language. I have tried finding a solution to this problem on this site but I find it quite difficult to explain what I'm looking for in the searchbox. Please excuse me if a solution to this has been posted before.</p>
  
  <p>So basicly I need to find <code>array[x][1]</code> for <code>x = input.readString()</code></p>
  
  <p>Example:</p>
  
  <p><code>array [0][0] = "book";</code></p>
  
  <p><code>array [0][1] = "lord of the rings";</code></p>
  
  <p><code>x = "book";</code></p>
  
  <p>I would now need a method that finds "lord of the rings" when the input is "book".</p>
  
  <p>Edit: Please forgive me for not adding this in the first place. This is an assignment for school and I need to use arrays, not hashmaps, sorry for wasting your time</p>
  
  <p>thanks in advance.</p>
  
  <p>update:</p>
  
  <p>gekozenCat is the input (book)
  TERADENWOORDEN is the array with  [0][0] = book and [0][1] = lord of the rings
  CATEGORIES = amount of categories</p>
  
  <p>am I doing something wrong here?</p>
  
  <pre><code>  String woordVanCat = woordBepalen (gekozenCat);
  
  public String woordBepalen(String teBepalenWoordVanCat) {
      for (int p = 0; p &lt; CATEGORIES; p++)
          if (TERADENWOORDEN[p][0].equals(teBepalenWoordVanCat))
          return TERADENWOORDEN[p][1];
  }
  </code></pre>