“It was an expression of her concern for others,” Professor Breen said. “She will be missed on campus and in class.”

Ms. Kennedy Hill spent part of her childhood in Ireland, and often said she was proud of her Irish heritage and her Gaelic given name, which means freedom. Her father, Paul Michael Hill, is one of the Guildford Four, who were falsely accused of involvement in Irish Republican Army bombings; he was imprisoned for 15 years before his conviction was overturned. He and Ms. Kennedy Hill’s mother married shortly after his release in 1993, and separated in 2006.

Ms. Kennedy Hill marched in Cape Cod with her mother in March 2018 as part of a nationwide protest against gun violence, according to The Barnstable Patriot.

The Kennedy compound on Cape Cod is the storied summer residence of one of America’s most enduring political dynasties. It consists of three white clapboard houses on six acres of waterfront property along Nantucket Sound and was originally the home of Joseph P. Kennedy, the patriarch of the Kennedy clan.

The compound was a base of operations for the presidential campaign of his son John F. Kennedy in 1960, and later served as a summer White House. Senator Edward M. Kennedy kept the home as his primary Massachusetts residence for several decades until his death in 2009.

In 2012, the Kennedy family donated the main house to the Edward M. Kennedy Institute for the United States Senate.

The death adds to a litany of tragedies that have befallen the Kennedys and taken on the grim aura of a family curse. President Kennedy and Senator Robert F. Kennedy were both slain by assassins. Their brother Joseph P. Kennedy Jr. was killed in World War II, and their sister Kathleen Cavendish died in a plane crash in 1948. The president’s son, John F. Kennedy Jr., was killed in 1999 when the airplane he was flying crashed into the Atlantic Ocean off Martha’s Vineyard; his wife and sister-in-law were on board and were also killed.