# Relation between age and spectral type of star

Does the spectral type of a star change as it ages? Since its temperature changes, I suppose the spectral type should also change, but I'm a bit confused about this. Also, is the spectral type entirely based on the star's spectrum? If yes, then why do we say O types are hotter and M types are cooler. I mean the statement is true but why not say that O types have very few lines and M types have a large number of lines? Or is it just a phrase stuck through history just like O type being early and M type being late stars (although this one is wrong)?

• This appears to be two separate questions: one about whether spectral types change throughout a star's evolution, and one about how spectral type relates to temperature. It would be better to ask one question per Stack Exchange question. – user24157 Sep 15 '20 at 18:51
• @antispinwards Sorry for that. Since the second question doesn't seem to have much significance, I thought of writing both together. Will keep it in mind to post one question, next time – Shakti Sep 16 '20 at 4:15