Identify which kind of sentence "They rested when night came"?

Identify which kind of sentence "They rested when night came"?

Explanation

Complex Sentence also consists of two parts.

One being the Principal or main clause while the other being a dependent or Subordinate clause, (which cannot stand by itself).

They rested when night came. Principal Clause they rested – makes sense.