2018-09-26 13:44:36 +00:00
|
|
|
import java.util.Vector;
|
|
|
|
import java.lang.Integer;
|
2023-01-23 12:56:21 +00:00
|
|
|
import java.lang.String;
|
2019-06-05 08:21:25 +00:00
|
|
|
|
|
|
|
public class VectorAdd {
|
|
|
|
vectorAdd(v1, v2) {
|
|
|
|
var i = 0;
|
2022-12-05 16:22:35 +00:00
|
|
|
v1 = new Vector<Integer>();
|
2019-06-05 08:21:25 +00:00
|
|
|
var erg = new Vector<>();
|
|
|
|
while (i < v1.size()) {
|
|
|
|
erg.addElement(v1.elementAt(i) + v2.elementAt(i));
|
|
|
|
i++;
|
|
|
|
}
|
|
|
|
return erg;
|
2019-07-11 13:52:38 +00:00
|
|
|
}
|
2023-01-23 12:56:21 +00:00
|
|
|
|
|
|
|
m(x, y, z) {
|
|
|
|
x = new Vector<Integer>();
|
|
|
|
y = new Vector<String>();
|
|
|
|
x.add(1);
|
|
|
|
y.add("2");
|
|
|
|
//Integer i = x.elementAt(0);
|
|
|
|
//String s = y.elementAt(0);
|
|
|
|
return z.addAll(x);
|
|
|
|
}
|
2019-06-05 08:21:25 +00:00
|
|
|
}
|