Recent studies have shown that mating can alter starvation resistance in female D. melanogaster, but little is known about the behavioral and physiological mechanisms underlying such mating-mediated changes in starvation resistance. In the present study, we first investigated whether the effect of mating on starvation resistance is sex-specific in D. melanogaster. As indicated by a significant sex × mating status interaction, mating increased starvation resistance in females but not in males. In female D. melanogaster, post-mating increase in starvation resistance was mainly attributed to increases in food intake and in the level of lipid storage relative to lean body weight. We then performed quantitative genetic analysis to estimate the proportion of the total phenotypic variance attributable to genetic differences (i.e., heritability) for starvation resistance in mated male and female D. melanogaster. The narrow-sense heritability (h2) of starvation resistance was 0.235 and 0.155 for males and females, respectively. Mated females were generally more resistant to starvation than males, but the degree of such sexual dimorphism varied substantially among genotypes, as indicated by a significant sex × genotype interaction for starvation resistance. Cross-sex genetic correlation was greater than 0 but less than l for starvation resistance, implying that the genetic architecture of this trait was partially shared between the two sexes. For both sexes, starvation resistance was positively correlated with longevity and lipid storage at genetic level. The present study suggests that sex differences in starvation resistance depend on mating status and have a genetic basis in D. melanogaster.