Solution 1:

The first is known as 'direct speech', the second as 'reported speech'.