U.S. Federal Reserve Chairman Ben Bernanke told law school graduates on Friday that the recession-mired U.S. economy would recover and to remain optimistic about their job prospects.

Things usually have a way of working out, he told the graduating class of the Boston College School of Law.

The U.S. central bank chairman broke no new ground on the outlook for monetary policy in a speech that described his path to leadership of the U.S. central bank.

It also included a little self-deprecating humor.

Bernanke recalled how he spoke a year earlier to a graduating class to which Harry Potter author J.K. Rowling also delivered an address. The student who introduced Bernanke jokingly described the two speakers as two of the great masters of children's fantasy fiction, he said.

On a more serious note, Bernanke cautioned students they are entering a weak labor market and will encounter trying economic conditions, but said the Fed is striving to rebuild stability and foster growth.

Restoring economic prosperity and maximizing economic opportunity are the central focus of our efforts at the Fed, he added.

The Fed chair told students to disregard pessimistic commentary about the future of the U.S. economy and its role in the world.

The economy will recover -- it has too many fundamental strengths to be kept down for too long -- and the mood will brighten, he said.

Bernanke offered wisdom from references to Bank of England Governor Mervyn King (the object of central banks should be to make monetary policy as boring as possible), scientist Louis Pasteur (Chance favors the prepared mind), and Beatle John Lennon (Life is what happens to you while you are busy making other plans).

(Reporting by Scott Malone, writing by Mark Felsenthal; Editing by Chizu Nomiyama)