A star can be classified according to the following: main sequence, giants, and supergiants. On the other hand, the spectral class of a star is classified according to their temperature, absolute magnitude and solar luminosity.
Based on an existing classification, a star with an identified spectral class of M2 and a magnitude of +15 would be classified as a main sequence star.