A simple Java program to determine when two trains will crash into each other.