His teaching style is loose: he wears khakis and open-necked shirts, insists that the students call him Stan, prods quiet students into talking and invites them all for runs with him and on overnight field trips to Gettysburg.

The theme in his case studies in leadership is that personal relationships matter — a view he set forth in another recent class about the 2010 Rolling Stone article, required reading, which quoted him and his staff as making dismissive comments about White House officials. Within days, President Obama fired him.

“That was a situation where it was completely unexpected, completely disorienting,” General McChrystal said in the interview. “Because you could have told me I was going to be killed by stampeding giraffes and I would have considered that more likely than I would have been accused of something like that,” he said, referring to the report that he had been disrespectful to the White House.

He took two leadership lessons from the experience, he said he had told his students: first, his relationships saved him — “I had this network of friends that reached out to me” — and second, it was better for the country that he step down without disputing the article. “I didn’t try to fight it,” he said, adding that he knew “by the time an investigation could be done that we would have created so much scar tissue.”

In the interview, General McChrystal declined to comment on the article’s accuracy, as he always has. (Last year, a Defense Department investigation found no proof of wrongdoing by General McChrystal or his aides; Rolling Stone questioned the methods of the investigators and stood by the article.)

General McChrystal said it was painful to relive the episode in class, but he saw it as his obligation. “The only reason I’m here to teach” compared with “somebody who’s got a Ph.D., is because I’ve been through it,” he said, speaking of the Rolling Stone episode as well as his military career. “So I think I owe them that.”

Admiral Mullen said that at Princeton, he, too, would draw on his decades in the military, particularly the debates over the escalations in Iraq and Afghanistan, which spanned his time as chairman of the Joint Chiefs. In speaking at campuses around the country, he said, he has found “a thirst and an intellectual curiosity” about the military, but also a lot of stereotyping.

“I think there’s a great deal of work to be done to talk to students about who we are,” he said.

Admiral Olson, a former member of the Navy SEALs who as head of Special Operations Command had a central role in planning the raid last year that killed Osama bin Laden, said the military had a lot to learn, too. His class at Columbia is to focus on irregular warfare, but he said he was most looking forward to “ideas and conversations that I wouldn’t otherwise have the opportunity to have.” In short, he said, “it’s an entry into a different world.”