A class of organic compounds containing a ring structure made up of more than one kind of atom, usually carbon plus another atom. The ring structure can be aromatic or nonaromatic.