“You’re probably wondering why I’m here,” comedian, actress, writer and producer Mindy Kaling said at Harvard Law School’s Class Day gathering.

Kaling, star of the Fox TV show “The Mindy Project” and producer, actress, and writer on the NBC sitcom, “The Office,” offered several reasons, all in trademark self-deprecating and offbeat sense of humor.

Graduates and families were probably thinking she was “just a pretty Hollywood starlet” who was too busy doing shampoo commercials to address them. In fact, the Cambridge native and Dartmouth grad said she was speaking to HLS because she was “obsessed with justice – not so much with the law, but with justice. Law is that pesky thing that often gets in the way of justice.”

Kaling told the graduates she was honored to be speaking to a class already distinguished with Rhodes Scholars, Fulbright Scholars and members of the Peace Corps.

She envisioned some graduates going on to start charities and philanthropic organizations. Others, she said, would go on to “noble pursuits” such as “helping a cable company acquire a telephone company” or “defending BP from birds.”

“One of you will sort out the details of my prenup. A dozen of you will sort out the details of my divorce. And one of you will fall in love in the process. I’m talking to you, Noah Feldman,” she chided.

Like her co-speaker at Class Day, Preet Bharara, U.S. Attorney for the Southern District of New York, Kaling spoke about her Indian American heritage. Her Indian parents, who met each other in Africa, “believed in the inherent fairness that is alive in America” – a place where they believed their children could ascend and take advantage of opportunities available to them nowhere else in the world. HLS graduates will go on to make laws and affect change that makes that possible for others. “What you decide to do in the next five to 10 years will affect the rights of people in a fundamental way,” she said.

“You are responsible for the language of justice,” said Kaling. “You take words and turn them into the infrastructure that keeps our world stable…One day you’ll have the power to make a difference. Use it well.”