In astronomy, stellar classification is a classification of stars based initially on photospheric temperature and its associated spectral characteristics, and subsequently refined in terms of other characteristics. Stellar temperatures can be classified by using Wien's displacement law, but this poses difficulties for distant stars. Stellar spectroscopy offers a way to classify stars according to their absorption lines; particular absorption lines can be observed only for a certain range of temperatures because only in that range are the involved atomic energy levels populated. An early scheme (from the 19th century) ranked stars from A to Q, which is the origin of the currently used spectral classes.
See more at Wikipedia.org...