Rocks have three main types or classes, which are sedimentary rocks such as limestone, igneous rocks such as obsidian, and metamorphic rocks such as marble. Sedimentary rocks are formed when layers of material accumulate and over time the materials harden into rock. Igneous rock forms when molten rock, called magma, cools and solidifies. Metamorphic rocks are formed beneath Earth's surface by intense heat and pressure that produce change.
Sedimentary rocks likewise have three types. Clastic sedimentary rocks are formed from debris produced by mechanical weathering, and some examples of this type are breccia, sandstone and shale. Chemical sedimentary rocks form when dissolved substances precipitate from solution, examples of which include rock salt and some limestones. Organic sedimentary rocks are made from accumulated plant or animal debris, and coal is an example of this type.
Igneous rocks are of two types. Intrusive igneous rocks form beneath Earth's surface, where the slowness of their cooling allows large crystals to form. Example of intrusive igneous rocks include granite and peridotite. Extrusive igneous rocks form on the surface and cool rapidly, forming small crystals. Basalt, obsidian and pumice are examples of extrusive igneous rocks.
There are also two types of metamorphic rocks. Foliated metamorphic rocks have a layered or banded appearance, and examples of this type include gneiss, schist and slate. Nonfoliated metamorphic rocks lack any such banded appearance, and examples include marble and quartzite.