title: How to Get Index of an Item in a 2D Array Java
body: <p>I'm having problems trying to get the index of a specific item from a 2D int array in Java.</p>
  
  <p>So here's what I have ...</p>
  
  <pre><code>private int[][] mobPoints = {
      {9300127,2},{9300128,2},{9300129,2},{9300130,3},{9300131,3},
      {9300132,3},{9300133,3},{9300134,4},{9300135,4},{9300136,5}};
  </code></pre>
  
  <p>The first number in each of the arrays is the mob identification number, and the second number is the number of points it's worth. How I want it to work is when a player kills a mob, the server detects that and sends it through a method that increments a variable with the amount of points the mob is worth. Example:</p>
  
  <pre><code>public void addPoints(int mobid) {
  
  }
  </code></pre>
  
  <p>What I'm having trouble doing is using the given mobid and retrieving the value it is worth. I don't want to use HashMaps or ArrayLists because I can't seem to predefine them (I have to create a new ArrayList and then add each and every value upon creation).</p>