title: Generate random string from a list of string with certain probabilities
body: <p>I am trying to generate random string from list of array string with required probablities in java.i am able to generate random string but dont know how do with probabilities.I have to run program almost 25 - 30 times </p>
  
  <pre><code>Probability for abc is 10%
             for def  is 60%
             for ghi is  20%
             for danny is 10%
  </code></pre>
  
  <p>But i am not able to do this.</p>
  
  <pre><code> import java.util.*;
  
  public class newyork
  {
  public static void main(String[]args) throws Exception
  { 
    // othr fun
      public static  void abc()
      {
      //Strings to display
          String [] random = {"abc","def", "ghi","danny"};
     //Pick one by one
          String no1= random[(int) (Math.random()*(random.length))];
          String no2 = random[(int) (Math.random()*(random.length))];
          String no3 = random[(int) (Math.random()*(random.length))];
  
    //print randomly generated strings
         System.out.println("Here you go : " +  no1 + " " +  no2 + " " + no3 + ");
      } 
  </code></pre>