Botanically speaking, a fruit is the mature ovary of a flowering plant, usually containing seeds.

Inside the coconut, there's a single large seed, which is the part that we often refer to as the "coconut meat" or "flesh.

In culinary terms and everyday language, coconuts are often referred to as nuts

This is likely due to their hard, fibrous outer shell and the fact that they have a seed inside.

it's classified as a fruit, specifically a "drupe," which is a fruit with a hard covering enclosing the seed

So, it's both a fruit and a nut, depending on the context in which you're discussing it

Coconut is a bit of an outlier in the world of classification