How to write a method in Java that detects the collision of two 2D balls and makes them change the vertical and horizontal direction?

How to write a method in Java that detects the collision of two 2D balls and makes them change the vertical and horizontal direction ?
How to write a method in Java that detects the collision of two 2D balls and makes them change the vertical and horizontal direction ?
0