I've tried looking it up but I couldn't find an answer. Could someone please tell me to what group of plants do coconuts belong depending upon the natural availability of water?
In terms of taxonomy and morphology:
Although coconut trees display considerable morphological diversity, they are considered taxonomically a single species (and the only species) within the genus Cocos. Based on stature and breeding, coconut cultivars can be divided into two groups: tall and dwarf. The former typically grows up to 35 to 40 meters and is mainly outcrossing, whereas the latter can only grow up to 25 to 30 meters and usually is selfing. Dwarf coconuts, which are less common than the tall variety, are usually found growing close to humans and have traits that likely result from human selection.
I've found little information about whether or not they are halophytes, hydrophytes, xerophytes,or mesophytes - but according to a Google Book, a number of crops are widely cultivated in non-saline soils, including Cocos nucifera (coconuts). Another Google book with a lot of information about coconuts states this: Some experiments show that a small quantity of salt added to the tree roots is beneficial.
Cocos nucifera also love sunlight, so they can be considered heliophytes.