title: Trouble referencing values from array
body: <p>I have a bit of an issue. Right now, as part of a chemistry program, I have:</p>
  
  <pre><code>public static Substance Na;
  public static Substance Br;
  
  public static Substance NaBr;
  
  public static Substance[][] combinations = {
               {NaBr, NaCl},
           {Na  , Na },
               {Br  , Cl }};
  combinations[0][0] = new compound(550);
  
  addCombination(combinations[0][0] , combinations[1][0], combinations[2][0]);
  </code></pre>
  
  <p>The goal here is to add a combination that uses Na and Br to make NaBr. Unfortunately, the program seems be referencing "combinations[1][0]" and "combinations[2][0]" as their own variables instead of the "Na" and "Br" they were meant to reference. If I substitute those values for "Na" and "Br" respectively, it runs like a charm!... any ideas on how to make the array recognized that it is only referencing the pre-initialized "Na" and "Br" instead of the ones in the Array? </p>
  
  <p>Any help would be much appreciated! Thank you in advance!</p>