The hard brown part is a seed. ( technically a drupe because it is surrounded by a fleshy fruit while a true nut is a fruit surrounded by a hard shell but let's not get technical) It comes from a fruit. To easily know whether something is a fruit is to know the definition of fruit and vegetable. A fruit is the mature ovary of any flowering plant. Seeds are contained in the fruit. A vegetable is any plant. Usually when people say vegetable they are referring to a plant used for food but any plant can be considered vegetation. Some things such as tomatoes, pumpkins, cucumbers etc. are both a fruit and a vegetable. The hard brown part of the coconut grows inside of a fruit which grows on a type of Palm Tree.