I recently started playing around with android and decided to try make a basic physics simulator, but I have encountered a small issue.

I have my object of Ball, each ball has a velocity vector, and the way I move it is by adding said vector to the ball's location with each tick.
It worked quite well until I noticed an issue with this approach.

When I tried applying gravity to the balls I noticed that when two balls got close to each other one of the balls gets launched great velocity.

After some debugging I found the reason for that happening.
Here is an example how I calculate force of gravity and acceleration:

```
    //for each ball that isn't this ball
    for (Ball ball : Ball.balls)
        if (ball != this) {
            double m1 = this.getMass();
            double m2 = ball.getMass();
            double distance = this.getLocation().distance(ball.getLocation());
            double Fg = 6.674*((m1*m2)/(distance * distance));
            Vector direction = ball.getLocation().subtract(this.getLocation()).toVector();
            Vector gravity = direction.normalize().multiply(Fg / mass);
            this.setVeloctity(this.getVelocity().add(gravity));
        }

```

Here's the problem - when the balls get really close, the force of gravity becomes really high (as it should) thus the velocity also becomes incredibly high, but because I add vector to location each tick, and the vector's value is so high, one of the balls gets ejected.

So that brings me to my questions - is there a better way to move your objects other than just adding vectors? Also, is there a better way to handle gravity?

I appreciate any help you guys could offer.