BERLIN — When Austria’s Parliament announced severe restrictions on movement on Sunday, two young Austrian roommates rushed to two supermarkets and a pharmacy before the rules came into force.

Andreas Bencic and Thomas Christl, both 25, weren’t stocking their own larder. Instead, they posted handmade signs outside each shop, each an offer to help the elderly or the infirm with their shopping during the coronavirus shutdown.

“You sit at home, you’re bored, you see the whole world is going nuts,” said Mr. Bencic, a student at the Vienna University of Economics and Business. “We thought it was a nice thing to do, just to protect the older generation.”

The early days of the coronavirus shutdown have sometimes been interpreted through the prism of intergenerational tension: The young, seemingly less at risk to the virus, party on as older people retreat into terrifying isolation.