title: selecting a random char in a string in java with a certain method
body: <p>I have to select and return 1 random character out of a string using this method (separate from main method):</p>
  
  <p>public  static  char selectAChar(String s)</p>
  
  <p>I'm not sure how to select the random variable, and not sure if i should use a for loop. everything I've tried I couldn't get it to return the right variable type.</p>
  
  <p>EDIT: heres the coding i have so far</p>
  
  <pre><code>public static void main(String args[])
  {
      Scanner kbd = new Scanner (System.in);
  
      System.out.println("Enter a string: ");
      String s = kbd.next();
  
      selectAChar(s);
  }
  
  
  
  public  static  char selectAChar(String s)
  {
  
  
  }
  </code></pre>
  
  <p>i tried something using this for loop
  for(int i = 0; i &lt; s.length(); i++)
  but i can't figure out how to choose a random character and return it.</p>