Hi I'm new to Java and I badly need help on how to implement the Set interface below:
Set.java
public interface Set {
public Set union(Set S);
public void add(Object x);
}
I have this code:
Test.java
public class Test implements Set{
public Set union (Set A){
}
public void add(Object x){
}
public static void main (String args[]){
Set A = new MySet();
}
}
Can you help me on how the methods should be implemented. I wanted to add an array to Set A and add values on that array. Then I'm going to pass those array to the union method. Thanks much.