“Perhaps he more forcefully could have refuted the hypothetical,” Captain Brown said. “He was trying to find an opportunity to use it to deliver a message on something positive, and that was the answer he gave on civilian control.”

There was no immediate official response from China to the admiral’s comments.

Rory Medcalf, the head of the National Security College and host of the talk, said the question had been posed to Admiral Swift without much context and had put him on the spot.

“Admiral Swift answered the question the only way a serving military officer could,” Mr. Medcalf said. “It would have been a lot more controversial if he had said no, he would not obey the commander in chief.”

Admiral Swift’s remarks in Canberra focused on the role of the armed forces in ensuring stability and a rules-based system of international relations. He spoke after war games conducted by more than 30,000 military personnel from Australia and the United States took place off the coast of Queensland and the Northern Territory of Australia. A Chinese Navy spy ship was operating nearby while the operations, known as the Talisman Saber exercises, were underway in the Coral Sea, the Australian military said.

China maintains a smaller nuclear arsenal than the United States or Russia, and has long said that it would not use nuclear weapons against a nation that did not have them or in a first strike against a nuclear-armed adversary. But there have been occasional calls to change that “no first use” policy. In 2005, a Chinese military official told a group of foreign reporters that Beijing should consider using nuclear weapons against the United States if it intervened in a conflict over Taiwan, the self-ruled island China considers part of its own territory.