title: Using string-array list length as an integer
body: <p>I'm using a random number generator to select an item out of an Android string array.  Is there a way to set my integer as the length of the array without actually counting the number of items in the array?</p>
  
  <p>Here's an example of the random number code I'm using:</p>
  
  <pre><code>private Random random = new Random();
  private int n = random.nextInt(4);
  
  private String randText;
  
  public Object(Context contex)
  {
  String[] string = context.getResources().getStringArray(R.array.text);
  
  randText = "Stuff to display " + string[n] +".";
  }
  
  public String getRandText
  {
  return randText
  }
  </code></pre>
  
  <p>I would like to define the "4" above as the length of a specific array list.  Anyone know how?</p>