President Barack Obama on Sunday denounced the tenor of the presumptive GOP nominee’s campaign, without ever mentioning Donald Trump by name, during a commencement speech at Rutgers University.

Obama told graduates at the New Jersey school that “building walls” is not the way of the future.

“The world is more interconnected than ever, building walls wont change that,” he said, clearly taking aim at the only candidate who has turned a facade into a plank.

“To help ourselves we’ve got to help others, not pull up the drawbridge and try to keep the world out,” Obama said.

He said building walls that prevent trade deals “won’t boost our economy,” and walls that keep out Muslims would alienate “the very partners in our fight against extremism.”

Obama also attacked the general stance of conservatives on climate change, saying the issue was “not subject to political spin.”

“There is evidence,” Obama said. “If we don’t follow through on the progress we made in Paris, your generation will feel the brunt of this catastrophe.”

“If you were listening to today’s political debate you might wonder where this strain of anti-intellectualism came from,” Obama told the group of about 12,000 graduates. “In politics and in life ignorance is not a virtue. It’s not cool to not know that you’re talking about. That’s not keeping it real or telling it like it is. That’s not challenging political correctness.”

RELATED: Obama Delivers Hopeful Speech as Howard Struggles to Stay Afloat

Obama pointed out that people usually value experience: They seek out doctors when they’re sick and pilots when they want to take a flight, “and yet, in our public lives we suddenly think, I don’t want somebody who’s done it before.”

“The rejection of facts, the rejection of reason and science that is the path to decline,” Obama said, warning that in an age of an influx of information, not everything should be taken as fact.

“Facts and evidence matter,” Obama said. “Hold our leaders accountable to know what the heck they’re talking about.”

While Obama acknowledged that the current political climate is frustrating, he told the graduates not to lose faith in democracy.

“The system isn’t as rigged as you think and not as hopeless as you think,” Obama said, urging the class to take part in the political process. “If you vote and you elect a majority that represents your view you will get what you want. It’s that simple. It’s not that complicated.”

This story first appeared on NBCNews.com.