Composition
Although there are 92 naturally occurring elements and a few hundred isotopes, the composition of stars is remarkably similar and simple. Stars are composed almost entirely of hydrogen and helium. A star such as our Sun is about 73% hydrogen by mass and 25% helium. If determined by number of nuclei then it is 92% hydrogen and 7.8% helium. The remaining 2% by mass or 0.2% by number is all the heavier elements. Historically astronomers termed these elements with atomic numbers greater than two as metals. These include elements such as carbon and oxygen. The use of "metals" is not to be confused with the more common chemical meaning of the term.
Metallicity is a measure of the abundance of elements heavier than helium in a star and is expressed as the fraction of metals by mass. It can be determined or at least inferred from spectroscopic and photometric observations. In general stars with higher metallicities are inferred to be younger than those with very low values. This is due to the fact that elements heavier than helium are made inside stars by nucleosynthesis and released into interstellar space by mass-loss events such as supernova explosions in the late stages of stellar evolution. Early generations of stars
Stars found in the spiral arms of galaxies, including our Sun, are generally younger and have high metallicities. They are referred to as Population I stars. Population II stars are older, red stars with lower metallicities and are typically located in globular clusters in galactic halos, in elliptical galaxies and near the galactic centre of spiral galaxies.sgseesseesse