operator [] method
Implementation
operator [](int index) {
switch (index) {
case 1:
return x;
case 2:
return y;
case 3:
return z;
default:
throw new IndexError(index, this, null, null, 3);
}
}
operator [](int index) {
switch (index) {
case 1:
return x;
case 2:
return y;
case 3:
return z;
default:
throw new IndexError(index, this, null, null, 3);
}
}