The object's distance = 10km
Displacement of the object = 0
From the line:
The distance from A to B = 5km
The distance from B to A = 5km
The object's distance = distance A to B + distance B to A
The object's distance = 5km + 5km
The object's distance = 10km
The displacement is the change in position of an object.
Displacement = final distance - initial distance
final distance = 5km
initial distance = 5km
Displacement = 5km - 5km
Displacement of the object = 0