A class of more than 400 NYPD recruits — a quarter of whom are foreign-born — was sworn in Thursday at the Police Academy in College Point, Queens.

The 438 officers, who will spend the next six months in training, were greeted by NYPD Commissioner James P. O’Neill, who reminded the young men and women that they can make a difference.

“Every time you interact with someone, you have a chance to change that life for the good,” he said. “Never forget that. It’s important.”

Nearly a third of the recruits are Hispanic, but the largest group, 41 percent, is white. About 16 percent are African-Americans and 10 percent are of Asian descent.

This is the first class to get all its coursework online.

The recruits come from 36 different countries, and from as far away as Uzbekistan, Albania and Singapore. They speak 25 different languages.

The best way the NYPD can best serve New York City, O’Neill said, is if its members reflect the ethnic diversity of its people.

“We can help people best if we can speak their languages, and if we understand their cultures,” he said.

This class has the second-highest percentage of women, at 22 percent, and the second-highest number of Hispanic recruits, at 31.6 percent, in the department’s history, officials said.