Though he avoided saying his name, nearly all of President Barack Obama's commencement address at Rutgers University on Sunday was dedicated to presumptive GOP nominee Donald Trump and his mix of anti-intellectualism and isolationism.

"In politics and in life, ignorance is not a virtue," Obama told graduates at the New Jersey university. "It's not cool to not know what you're talking about. That's not keeping it real, or telling it like it is. That's not challenging political correctness. That's just not knowing what you're talking about."

He added: "When our leaders express a disdain for facts, when they're not held accountable for repeating falsehoods, and just making stuff up while actual experts are dismissed as elitist, then we've got a problem. The rejection of facts, the rejection of reason and science, that is the path to decline."

As an example, Obama mentioned Sen. Jim Inhofe (R-Okla.), who threw a snowball on the floor of the U.S. Senate last December in an attempt to disprove scientific consensus on man-made climate change.

"Climate change is not something subject to political spin. There is evidence," he said, adding, "Imagine if your fifth-grade science teacher had seen that. He'd get a D!"

The president argued that building walls and closing borders would hurt America, anger its allies, and threaten the country's ability to solve global problems like the Ebola virus.

"The world is more interconnected than ever before," he said. "Building a wall won’t change that.”

Obama also waded into the debate over campus "PC culture," chiding Rutgers students who protested former Secretary of State Condoleezza Rice as a graduation speaker in 2014 as "misguided."

"If you disagree with somebody, bring them in, ask them tough questions," he said. "Stand up for what you believe in. Don't be afraid of somebody."

He closed by urging students to be optimistic and engaged in the political process, saying that "cynicism is so easy, and cynics don't accomplish much."

"The system isn't as rigged as you think, and it certainly isn't as hopeless as you think," he said.

Editor’s note: Donald Trump regularly incites political violence and is a serial liar, rampant xenophobe, racist, misogynist and birther who has repeatedly pledged to ban all Muslims — 1.6 billion members of an entire religion — from entering the U.S.