class Vector2D{
...
/**
* Combine the two vectors into this vector
* @param other amount to add to this
*/
public void add(Vector2D other) {
{
//_x += other.getX();
//_y += other.getY();
_x += other._x;
~~~~~~~~~~~~~~ _x is private, however you can still call
other._x within the Vector2D class.
}
}
...
}
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment