Is pain used to mean the same thing in the next two sentences?

The pain of loneliness.

That kid is a terrible pain.
different meanings