- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
//сложение двух векторов
public Vector sum(Vector vector) throws Exception {
if (vectorSize != vector.vectorSize) {
try {
throw new Exception("different size");
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
Vector result = new Vector(vectorSize);
for (int i = 0; i < vectorSize; ++i) {
result.vector[i] = this.vector[i] + vector.vector[i];
}
return result;
}
>e.printStackTrace();
Оджнозначно!
слабо представляю одномерные векторы
> это не лаба
Остаётся только посочувствовать.... суммирование с throws Exception...
+1
try {
throw new Exception("different size");
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}