A few students wrote negatives like “blood” and “imperialism.” But by and large, the class of 18 sophomores and juniors voiced a striking degree of confidence in the military.

In fact, researchers and polling experts say, the class reflects a long-building trend that has intensified with the attacks on Sept. 11, 2001, and the successful military actions in Afghanistan and Iraq.

Americans’ trust and confidence in the military has soared, even as it has declined in other institutions like corporations, churches and Congress.

From 1975 to 2002, the percentage of Americans who expressed a “great deal” or “quite a lot” of confidence in the people who ran organized religion fell, to 45 percent from 68. Those expressing a great deal or a lot of confidence in Congress declined, to 29 percent from 40, according to a Gallup Poll. But also in 2002, Americans who expressed a great deal or a lot of confidence in the military rose, to 79 percent from 58 in 1975.

The positive image is particularly striking among the children and grandchildren of baby boomers, said David C. King, an associate professor of public policy at Harvard and co-author of the new book “The Generation of Trust: How the U.S. Military Has Regained the Public’s Confidence Since Vietnam” (American Enterprise Institute for Public Policy Research).

Those generations have come to “trust the government, and especially the U.S. military, more deeply than their baby boomer parents ever have,” Professor King said.

Neil Howe, a co-author of books about generations who has consulted with the military on recruiting, said: “The idea of nationality, being a nation, is important to people shaped by 9/11. This is a generation that knows nations really matter. They trust government.”

They are also steeped in the values of cooperation, teamwork and service in the schools, Mr. Howe said, adding, “‘All of these things argue in favor of trust, or support, of the military.”

Opinion polls back that up. A poll by the Harvard Institute of Politics, based on interviews with 1,200 college undergraduates last month, found that 75 percent said they trusted the military “to do the right thing” either “all of the time” or “most of the time.” Two-thirds of the students said they supported the Iraq war. Hawks outnumbered doves more than 2 to 1.

In contrast, in 1975, 20 percent of people ages 18 to 29 said they had a great deal of confidence in those who ran the military, a Harris Poll found.

Researchers argue that the trend in part reflects simple experience. Young people coming of age during quick and successful military actions, like the Persian Gulf war in 1991—“It looked and felt like a video game, and America won it decisively,” Professor King said—or the action in Iraq this year are quite likely to have very different attitudes from those who came of age during the Vietnam War.

“How the military is doing has a lot to do with it,” a sophomore in Mr. Sunderdick’s class, Jessi Dexheimer, 15, said. “Now that they’ve done so well in Iraq, people feel good about them. But people felt differently about Vietnam.”

Todd Gitlin, a professor of sociology at Columbia and a scholar of the 1960’s, said: “If you grew up in the 60’s, the military is to some degree tainted. I won’t say forever tainted. But it is tainted by its implication in the Vietnam War. And if you came of age in the last five or six years, the military looks a lot more like defense than aggression.”

Professor King said his research showed that people born in 1952 reflected the lowest level of trust in the military. They were 16 in the year of the Tet offensive, the assassinations of Robert F. Kennedy and the Rev. Dr. Martin Luther King Jr. and a high water mark in the antiwar movement.

In Mr. Sunderdick’s class, Vietnam seemed very distant history. Even the teacher was born after Saigon fell. Several students said they thought that the Iraq war was much more like World War II, a war with a clear rationale waged by a country intent on defending itself, reflecting the effectiveness of the Bush administration’s case for going to war.

“We actually got attacked,” a student, Jessica Cowman, said. “In Vietnam, it wasn’t an attack on us. We got hit in World War II, at Pearl Harbor, and we got hit in New York and at the Pentagon. It wasn’t like that with Vietnam.”

Another student, Stephanie Isberg, said: “People are more personally affected, especially by 9/11. My uncle almost died. So I have a more positive viewpoint about going in and taking out terrorists than I probably would have if nothing had happened.”

Since Sept. 11, 2001, Mr. Sunderdick said later, students in his government classes seemed far more engaged “in how things work, why we do what we do.”

Another teacher, Angela Sugg, head of the social studies department at Mount Hebron, said she had noticed more students reciting the Pledge of Allegiance since Sept. 11, 2001.

Peter D. Feaver, an associate professor of political science at Duke and an expert on relations between military and civilians, said the terrorist attacks brought home to Americans their “personal connection to the mission of the military.”

“In the post-cold-war era,” Professor Feaver said, “from when the walls fell down to when the towers fell down, Americans didn’t have a lot of personal connection to the mission. It was what I called a voyeuristic connection to the military.”

There are other factors. Professor King said the military had improved its performance and professionalism, symbolized by “a well-trained all-volunteer force.” Added to that are years of advertising by the services and, even more important, popular culture. The dark movies about Vietnam gave way to more upbeat visions like “Top Gun” and “An Officer and a Gentleman.”

Even so, the growing popularity does not, necessarily, translate into a surge in enlistments, experts say.

Spokesmen for the Army, Navy, Air Force and Marines said they were all hitting their recruiting goals even before the terrorist attacks and the ensuing military actions, and that they had been doing so for at least the last few years.

A spokesman for the Air Force Recruiting Service, First Lt. Jason McCree, said calls as well as visits to the Air Force Web site increased when the Iraq war began.

“As far as qualified applicants coming up to recruiters,” Lieutenant McCree added, “we have not seen an increase. We’ve been doing really well as far as recruiting, and we’ve continued to do well.”

In Mr. Sunderdick’s class, all the students said they viewed the military positively and supported the troops; 7 of the 18 said they would consider the military as a potential career.