HONOLULU — President Obama said in a radio interview that began airing on Monday that Donald J. Trump, a leading contender for the Republican presidential nomination, was exploiting the resentment and anxieties of working-class men to boost his campaign. Mr. Obama also argued that some of the scorn directed at him personally stemmed from the fact that he is the first African-American to hold the White House.

Demographic changes and economic stresses, including “flat-lining” wages and incomes, have meant that “particularly blue-collar men have had a lot of trouble in this new economy, where they are no longer getting the same bargain that they got when they were going to a factory and able to support their families on a single paycheck,” Mr. Obama said in the interview with National Public Radio.

“You combine those things, and it means that there is going to be potential anger, frustration, fear — some of it justified, but just misdirected,” the president added. “I think somebody like Mr. Trump is taking advantage of that. That’s what he’s exploiting during the course of his campaign.”

The comments were Mr. Obama’s most pointed response to Mr. Trump since the Republican candidate suggested that Muslims be barred from entering the United States after the mass shooting in San Bernardino, Calif. The attack was carried out by a couple who apparently were radicalized Muslims, one of whom had entered the United States on a fiancée visa.