After attacking Boeing and Lockheed Martin on Twitter over the costs of military contracts, President-elect Donald J. Trump met Wednesday with the chief executives of the two aerospace companies, saying his goal was to try to “bring costs down.”

Mr. Trump said he was mainly concerned about Lockheed Martin’s new F-35 fighter jet, which, at $400 billion for 2,400 jets, “is very, very expensive.” Asked if he had won any concessions in the meeting, he said, “We’re just beginning, it’s a dance.”

“We’re going to get the costs down,” he added, “and we’re going to get it done beautifully.”

Mr. Trump said he also was “looking to cut a tremendous amount of money” from a Boeing program to build new Air Force One planes that provide mobile command centers for the president.

Boeing has received only a $170 million contract to study initial concepts. But Mr. Trump asserted in a Twitter post on Dec. 6 that the estimated costs were “out of control, more than $4 billion,” adding, “Cancel order!”