NEW YORK - US President Barack Obama Sunday indirectly slammed Donald Trump during his commencement address at Rutgers University in New Jersey, decrying "anti-intellectualism" and noting that "ignorance is not a virtue."

Obama did not specifically name the presumptive Republican nominee while speaking before the graduating class, but he did mention many of the billionaire businessman's controversial ideas, including temporarily banning Muslims from entering the US and building a wall between the US and Mexico.

“Let me be as clear as I can be: in politics and in life, ignorance is not a virtue,” Obama said, according to CBS News. “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. And yet we’ve become confused about this.”

“Isolating or disparaging Muslims, suggesting they should be treated differently when entering this country — that is not just a betrayal of our values, that’s not just a betrayal of who we are, it would alienate the very communities at home and abroad that are our most important partners in the fight against violent extremism,” he added.

The president also spoke about the important qualities that the more than 17,000 graduates before him should look for in policymakers, including “facts, evidence, reason, logic.” He noted the dangers of keeping the U.S. isolated from the rest of the globe. “The world is more interconnected than ever before and it’s becoming more connected every day,” Obama added. “Building walls won’t change that.”

Obama seemed to especially take pleasure in advocating the use of facts in politics while speaking to an academic audience. His point with such arguments is usually to press for action against climate change, one of the signature policies of his administration and one that nearly all climate scientists support.

But while Obama mentioned climate change, he also used his points about facts and experience to take yet another swipe at an unnamed Trump.

He noted that when people get sick, they want an experienced doctor to treat them; when they fly, they want experienced pilots. “And yet in our public lives, we suddenly say, ‘I don’t want somebody who’s done it before’?” he asked in derision.

Trump has no experience as a politician, a quality that has been viewed as one of the most important reasons for his success as a presidential candidate.