John H. Shenefield, President Carter's nominee to head the Justice Department's Antitrust Division, said yesterday he personally supports legislation requiring major oil companies to divest themselves of their interests in coal and other energy sources.

"If I were a sitting senator, I would vote 'aye,'" Shenefield said in response to a question from Sen. Edward M. Kennedy (D. Mass.). Kennedy, chairman of the Antitrust and Monopoly Subcommittee, posed the query during hearings on Shenefield nomination as assistant attorney general for antitrust.

"What is disturbing is that while one particular merger may not be illegal, what one sees evolving over a period of time is a striking example of cross - ownership of energy resources," Shenefield told the Judiciary Committee.

Where there appears to be a crossover in technology between one energy source and another, some mergers may not be illegal, whatmake some sense, he suggested. But he noted there seems to be no similar technology used in oil and solar energy, for example.

He suggested that Congress could "carve out" certain areas which would be unavailable for mergers by energy companies, or could "at least put the burden on those doing the acquiring" to show that a prospective mergers is in the public interest.

Shenefield also said he personally supports divestiture by the oil companies of their ownership of the pipelines through which the oil is transported.

In response to a question from Sen. Charles McC. Mathias Jr. (R - Md.), he noted that a recent division report suggested that producer ownership of pipelines could lead to either monopoly profits or restricted supply. "Divestiture may be the only appropriate means" of preventing that, he added.

He said he does not favor the so - called vertical divestiture legislation which would break up the major oil companies' control over every facet of the petroleum business exploration, production, transportation, refining, distribution and marketing.

The legislation generally would let the companies choose between exploration and production on the one hand, or refining and marketing on the other.