BEIJING — Both came to power vowing to restore their nations to greatness. But America’s loud, ad-libbing president-elect, Donald J. Trump, and China’s guarded, calculating president, Xi Jinping, are glaring contrasts as politicians, and their pairing has injected new unpredictability into relations between their governments.

“I could not think of two more different protagonists in the great drama of U.S.-China relations,” Evan S. Medeiros, formerly the senior director for Asian affairs at the National Security Council, said by email. “Personalities matter a lot in international relations, especially between great powers.”

A quarrel after China seized an underwater drone from the United States Navy has given a taste of how Mr. Trump’s and Mr. Xi’s different styles could play out if bigger tensions were to break out over the South China Sea, trade imbalances, North Korea’s nuclear weapons or other issues that Mr. Trump has raised.

Mr. Trump has recently blared warnings at China, seemingly guided by visceral reflexes and a vague but bold set of demands. By contrast, Mr. Xi, the son of a Communist veteran, is disciplined and steely. He rarely speaks off the cuff in public. Even his seemingly impromptu gestures are often carefully choreographed, and he usually adheres to policy points when meeting foreign leaders. Mr. Xi is certainly capable of bold action, as he has shown in the South China Sea, but he tends to shroud his thinking in a cloud of slogans. That leaves outsiders guessing about when and how he will act on his demands.