title: Create ten instances of a class simultaneously using threads
body: <p>I am trying to understand threads in Java. As an exercise, I created an Ice Cream class as follows.</p>
  
  <pre><code>public class ThreadIceCream {
  
  private String flavor = "";
  private String[] specialFlavors = { "Vanilla", "Chocolate", "Butter Pecan", "Strawberry", "Chocolate Chip", "Cherry", "Coffee" };
      // Constructor for ThreadIceCream class
  public ThreadIceCream() {       
      int randInt = (int) (Math.random() * specialFlavors.length);
      flavor = specialFlavors[randInt];
      System.out.println("Enjoy your " + flavor + " IceCream!");
  } }
  </code></pre>
  
  <p>The ThreadIceCream class is a simple class that creates an IceCream object with a random flavor every time the class is initialized. Here is the TestStub I am using.</p>
  
  <pre><code>public class TestStub {
  
  public static void main(String[] args) {
  
      ThreadIceCream Th1 = new ThreadIceCream();
      ThreadIceCream Th2 = new ThreadIceCream();
  
  } }
  </code></pre>
  
  <p>Now I want to create 10 Icecreams (i.e. Create 10 instances of the ThreadIceCream class simultaneously) and I want to use threads in Java to do this. I tried a few things but they were no were close.</p>