Do the different types of coal (such as anthracite, lignite, and bituminous) have different amount of energy?
Yes, in general as the rank of the coal increase, so does the energy content - at least to a point.
The energy content of coal tends to increase as its rank increases as over time the carbon content increases per volume of coal and water tends to get squeezed out in the coalification process The Heating Value in the attached diagram shows this effect.
Cola of different types contains different things at different ratios.
coal contain ash.It may vary from 5% to 40 in some coal like lignite,
Calorific value the index which indicate heat value changes.
In addition to carbon and hydrogen coal also contain sulfur .nitrogen and other things.
Ash does not produce heat.