I am trying to add information from main () to an element class where I store information in hashset
i has 3 classes
I am adding CD information. firstly, I add a group, # songs, the name works well
then in another function I'm trying to add group members. I want to keep them separate. Where I have problems, we assign group members.
I understand how Varargs works, just not sure how to assign this to a string.
I will only show bits of code to keep this post simple and short.
this is what i have:
Main ()
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);
}
Then here is the first function called ...
public void addBandMembers(Item musicCD, String... members)
{
}
Then in another class I try to add information.
private String members;
public void addband(String... member)
{
this.members = member;
}
String;
.. ..
public String getMembers()
{
return members;
}
?
oh ya, .
public class Library
{
private Set<CD> theCDs = new HashSet<CD>();
private Set<DVD> theDVDs = new HashSet<DVD>();
private Set<Book> theBooks = new HashSet<Book>();
, ..
.
user249375