title: Creating an array of Sets in Java
body: <p>I'm new to Java so I'm probably doing something wrong here,
  I want to create an array of Sets and I get an error (from Eclipse).
  I have a class:</p>
  
  <pre><code>public class Recipient 
  {
  String name;
  String phoneNumber;
  
  public Recipient(String nameToSet, String phoneNumberToSet)
  {
      name = nameToSet;
      phoneNumber = phoneNumberToSet;
  }
  
  void setName(String nameToSet)
  {
      name = nameToSet;
  }
  
  void setPhoneNumber(String phoneNumberToSet)
  {
      phoneNumber = phoneNumberToSet;
  }
  
  String getName()
  {
      return name;
  }
  
  String getPhoneNumber()
  {
      return phoneNumber;
  }
  }
  </code></pre>
  
  <p>and I'm trying to create an array:</p>
  
  <pre><code>Set&lt;Recipient&gt;[] groupMembers = new TreeSet&lt;Recipient&gt;[100]; 
  </code></pre>
  
  <p>The error I get is "Cannot create a generic array of TreeSet"</p>
  
  <p>What is wrong ?</p>