Mr. Zhu’s parents also testified that they had taken no concrete steps to prepare for the use of the sperm, that they had not begun looking for a potential surrogate or potential eggs, and that they had not retained a physician to assist them with any of these matters, the judge wrote.

Justice Colangelo said the court would place no restrictions on the use of Mr. Zhu’s sperm by his parents because neither state nor federal law required them.

But whatever course of action they choose to pursue may need to be reviewed in light of “legal, practical and ethical concerns, including the potential reluctance of medical professionals to assist in such a procedure,” he wrote.

Lauren Sydney Flicker, a bioethicist and expert in post-mortem sperm retrieval at Albert Einstein College of Medicine in the Bronx, said requests to retrieve the sperm of a dead person are not “shockingly rare.”

Most major medical centers receive a few such requests each year, she said, usually from a romantic partner of the deceased. But many doctors do not know the procedure is possible and there are no databases that track it nationwide, she said.

“Here is the ethical debate, and it will be different for different people: Is it a greater ethical burden to prevent someone from having the opportunity to be a father by passing along their genetic material?” she said. “Or is it a greater ethical burden to have a man father a child, without his consent, that he wouldn’t be around to raise?”

The case of Mr. Zhu’s parents raises unique challenges, she said.

“They are going to have to find someone who is willing to be a surrogate and a fertility clinic that is willing to transfer their son’s gametes into a surrogate so that they can raise a child,” she said. They will also have to pay for in vitro fertilization, which is typically not covered by insurance.