Mr. Abe responded with equal warmth, congratulating Mr. Trump on his inauguration and welcoming his commitment to the defense treaty while sidestepping questions about Mr. Trump’s withdrawal from the Trans-Pacific Partnership. “With the birth of the Trump administration, a new genesis will be built between Japan and the U.S. in economic relations,” he said.

Acutely aware of Mr. Trump’s complaints about foreign competitors, Mr. Abe stressed that “Japanese businesses have built factories all over the United States” and invested $150 billion, creating many American jobs. “Japan, with our high level of technical capability, we will be able to contribute to President Trump’s growth strategy,” he said. “There will be even more new jobs being born in the United States.”

He specifically cited Japan’s bullet-train technology, noting that if it existed along America’s Eastern corridor, it would take “only one hour” for the president to travel from the White House in Washington to Trump Tower in New York.

While he stuck to positive themes during their public comments, Mr. Abe may have questions in private for Mr. Trump about his provocative statements related to Japan, including his warning to Toyota on Twitter that he would slap a “big border tax” on the carmaker if it built a new plant in Mexico and his charges that Japan devalues its currency to gain economic advantage.

Mr. Abe was the first foreign leader to visit Mr. Trump after his election in November, and they have spoken a number of times since then, according to the officials.

By contrast, the president has gotten off to a chilly start with Mr. Xi, who was angered by Mr. Trump’s decision in November to take a congratulatory call from the president of Taiwan — which China considers a breakaway province — and his subsequent questioning of the “One China” policy. Mr. Trump had a fence-mending call with Mr. Xi on Thursday night and agreed to honor the One China policy at the Chinese leader’s request.

“We had a very, very good talk last night and discussed a lot of subjects,” Mr. Trump said. He predicted that he would get along with China and forge a fairer playing field on trade and currency. “I believe that will all work out very well for everybody, China, Japan, the United States and everybody in the region,” he said.