Can somebody please help me understand what the output of this code would be. I believe I am getting the wrong output due to some technical problems with my computer.
public class SetDemo {
public static void main(String[] args) {
SetInherit inherit = new SetInherit();
SetComposition comp = new SetComposition();
System.out.println(inherit);
inherit.add(1);
System.out.println(inherit);
inherit.add(1);
System.out.println(inherit);
inherit.add(2);
System.out.println(inherit);
inherit.add(3);
System.out.println(inherit);
inherit.add(3);
System.out.println(inherit);
inherit.add(4);
System.out.println(comp);
comp.add(1);
System.out.println(comp);
comp.add(1);
System.out.println(comp);
comp.add(2);
System.out.println(comp);
comp.add(3);
System.out.println(comp);
comp.add(3);
System.out.println(comp);
comp.add(4);
}
}