Do corals have brains?

Corals don’t have a brain but have a simple nervous system called a nerve net. The nerve net extends from the mouth to the tentacles.

They do not have brain but they know how to get hungry by extending their tentacles?

Corals have a nervous system similar to that of jellyfish, anemones, and hydras. They aren’t advanced enough to have a brain or central nervous system, but have a nerve net, that is the reason why they need food