How to join (connect) line segments into one line?

Suppose I have two lines (disjoint) and I want to make them into one line (join two endpoints). Is that possible, and how?
Thanks