Firstly, in oxford dictionary,
furit:
the part of a plant that consist of a stone/pit or seed and flesh, can be eaten as food and unusually tastes sweet.
vegetable:
a plant or part of a plant that is eaten as food such as patatoes,beans and so on.
secondly,the coconut is the part of coconut-palm, that consist of a flesh and seed can be eaten as food and tastes sweet.
thirdly, we can conclude that coconut is a kind of fruit.