'In time' and 'on time'

Could you tell me the difference between 'on time' and 'in time'?

'On time' means at the correct time or punctual. It is often used to talk about transport timetables.

 The plane arrived on time.
e.g. Paul is on time for all his classes.

'In time' means 'early enough'.

e.g. I finished my homework just in time. The teacher collected it two minutes later!
e.g. Pauline really hopes Anita can finish making her dress in time for her wedding.

We hope we answered this question in time!