Marian Marian - 1 month ago 4x
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

Try this !!

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

public Schedule(Set<Seance> schedule) {
   this.schedule = schedule;