Does the word "line" have the same definition in the next two sentences?

He got out of line.

Toe the line.
the same meaning