What is the datatype of a Java varargs (...) parameter?
<p>I am trying to add information from main()
to a items class where i am storing the information in a hashset</p>

<p>i have 3 classes</p>

<ol>
<li><p>project - main()</p></li>
<li><p>libaray -  addBandMembers function</p></li>
<li><p>Item - addband(String... member)</p></li>
</ol>

<p>i am adding CD information. first, i add band, # of songs, title - which works good</p>

<p>then in another function i am trying to add the band members. I want to keep these separate.
Where i am having problems is assign the band members..</p>

<p>I understand that how Varargs works just not sure how to assign that to a string..</p>

<p>I will only show bits of code to keep this post simple and short..</p>

<p>this is what i have:</p>

<p>Main()</p>

<pre><code>item = library.addMusicCD("Don't Let Go", "Jerry Garcia Band", 15, "acid rock", "jam bands");
if (item != null) {
library.addBandMembers(item, "Jerry Garcia", "Keith Godcheaux");
library.printItem(out, item);
}
</code></pre>

<p>Then, here the first function thats called..</p>

<pre><code>public void addBandMembers(Item musicCD, String... members)
{

   //musicCD.addband(members);   // both cant find addband function..
    //Item.addband(members);

}
</code></pre>

<p>Then in another class i am trying to add the information..</p>

<pre><code> private String members;  


public void addband(String... member)
{
    this.members = member;     // error

}
</code></pre>

<p>if i make the private String members; an array
then this function below errors.. incompatible type..</p>

<pre><code> public String getMembers()
{
 return members;   
}
</code></pre>

<p>How can i do this?</p>

<p>oh ya, here is my set..</p>

<pre><code>public class Library
{
private Set&lt;CD&gt; theCDs = new HashSet&lt;CD&gt;();
private Set&lt;DVD&gt; theDVDs = new HashSet&lt;DVD&gt;();
private Set&lt;Book&gt; theBooks = new HashSet&lt;Book&gt;();
</code></pre>

<p>if you need to see more code let me know..
Thank you so much..</p>
