Some trees have a single "gender" but many do not. The way to tell is to see if the male (pollen) parts are present on separate flowers on different trees from the "female" (ovary - ie, infant fruit) parts. Also, you should be aware that issues with pollination may not always be related to needing both "male" and "female" trees around - sometimes a tree has what is called a "perfect" flower (with both male and female parts) but because the pollen from the male portion does not ripen at the same time or is in some other way incompatible with the female portion, it may require others of its kind around with different pollination times in order to set fruit. Apples are that way, sometimes, as are hazelnuts. This is why you often see recommended pollinators listed for certain apple varieties.