McCartney told the students, "Sometimes the situation in the world is so crazy, that you've got to address it".
However, McCartney did not give a clue whether the song written by him was in favor of Trump or against. He said that he felt he had to write it.
"Sometimes the situation in the world is so crazy, that you've got to address it," he added.
When asked about the US president earlier this month he mentioned that he is not a fan at all.
Further quoting he said, "he's unleashed the ugly side of America. People feel like they have got a free pass to be, if not violent, at least antagonistic towards people of a different color or a different race. I think we all thought we'd got past that a long time ago".
While commenting on his song he also mentioned indirectly that Trump's followers will not be a fan of the song.
Back in 2016, McCartney's support for Trump's opponent, Hilary Clinton, was revealed when he took a picture with her outside before a show he was to do in Cleveland.