Having trouble creating a constructor that takes multiple one dimensional arrays of Strings:
class relation {
String[] setA, setB, setC;
relation (String[] setA, String[] setB, String[] setC) {
this.setA = setA;
this.setB = setB;
this.setC = setC;
}
}
public class matrix {
public static void main(String[] args) {
relation relation1 = new relation({"1","2","3","4","5"}, {"1","2","3","4"}, {"2","3","4","5"});
relation relation2 = new relation({"a","b","c","d"}, {"a","b","c","d","b","c"}, {"a","b","c","d","c","b"});
}
}
I keep getting multiple errors - Syntax error on token(s), misplaced construct(s) - Type mismatch: cannot convert from String[] to relation - Syntax error on token "}", delete this token - Syntax error on token ")", } expected
I need to be able to use each array separately withing the relation class.