Marian Marian - 1 year ago 92
Java Question

How create constructor with Set field and parametrs TreeSet

public class Schedule {

private Set<Seance> schedule;

public Schedule(){}

public Schedule(??) {
// ??

I need some this:
private Set<> schedule = new TreeSet<>();
but i need do this in constructor, because i want use Schedule object by sort object Seance/// and this object Schedule I want add to MAP... help please. And sorry for my english)

Pat Pat
Answer Source

Try this !!

public Schedule(){
schedule = new TreeSet<Seance>();

public Schedule(Set<Seance> schedule) {
   this.schedule = schedule;
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download