How is the sun an example of nuclear energy?
Nuclear energy is what powers the sun.
The material of the sun (primarily hydrogen) contracted into into itself by gravitation to form the body. The extreme pressure forced the hydrogen atoms to fuse (fusion) into helium, releasing huge mounts of energy.
As stars age this process not only continues, but advances to the formation of heavier elements as well. The lifecycle of stars is defined by their initial mass, the rate of reactions and the energy release compared to the gravitational force of its mass.
The Sun is a good example of nuclear energy as it utilises nuclear fusion, radioactive decay and particle annihilation.
The Sun's core is mainly Hydrogen under high temperatures and pressures. The Sun's main source of energy is the proton-proton chain reaction which actually involves three types of nuclear energy producing reactions.
First of all the temperature and pressure allow two protons get close enough for the strong nuclear force to overcome the electrostatic repulsion and fuse them into the highly unstable Helium-2.
Most of the Helium-2 nuclei fly apart, but relatively rarely the weak force will turn a proton into a neutron a positron and an electron neutrino to for deuterium and releasing energy.
The positron almost immediately annihilates with an electron releasing more energy.
A proton then fuses with deuterium to produce Helium-3 plus a high energy photon.
Finally two Helium-3 nuclei combine to form Helium-4 and two energetic protons.
So, there are three nuclear reactions going on in the Sun, fusion, weak decay and electron-positron annihilation.