Does the word "ball" have the same definition in the next two sentences?

He played with his rubber ball in the bathtub.

He threw nine straight balls before the manager yanked him.
different meanings