Like friends who have been on a long, dangerous trek together and come to an abyss, Japan and the United States are staring into an uncertain future and trying to figure out what to do next.

But the effort to get to this point has affected them differently.Americans are worn out by decades of military expenditure and disillusioned by their empty pockets.

The Japanese are prosperous, robust and increasingly confident - and more willing than ever to openly express resentment over high-handed pestering by a weakened partner.

This has led to charges and countercharges of racism in public debate as Japanese politicians demean the American work ethic, and their U.S. counterparts complain of sneaky, predatory business dealings.

As the Japanese see it, the Americans are unwilling to deal with their internal problems and are demanding that Japan alter its hugely successful economic system - partly as a form of repayment for helping the country recover from its World War II humiliation.

And with their reliance on the U.S. nuclear umbrella shrinking, the Japanese are asserting the right to be treated as an equal of the United States and to take a permanent seat on the United Nations Security Council.

Although analysts in Japan project a long-term improvement in the government-to-government relationship, some worry that the recent waves of mutual antagonism will not subside until Americans recapture a measure of self-confidence and the Japanese grow out of their newfound arrogance.

Yukio Okamoto, a consultant who headed the U.S. division of the Japanese Foreign Ministry before going into business for himself last year, worries that the U.S. presidential election campaign will give rise to even more damaging rhetoric.

Once the dust settles, Mr. Okamoto said, there is cause for optimism: ''Interdependence has grown to such a level that for one to alienate the other is really to shoot your own foot."

But until both sides fully acknowledge that fundamental point, he said, they will at least have to back off from each other's sensitivities.

"Japan is going to have to grow up from its childish arrogance, from acting like kids who boast about how rich their father is or what new clothes they have," he said. "And Americans are going to have to stop blaming their problems on a bunch of cunning, sneaky guys who're trying to limit imports by all means possible."

According to Robert M. Orr, director of the Stanford Japan Center in Kyoto, Japanese and Americans have reached a stage in their relationship where they're saying out loud what they've repressed for decades.

"Japanese love America, but they don't respect it," he said, "Americans respect Japan, but they don't love it."

While there seems little doubt that most Japanese view the United States as a faltering colossus, the intensity of attitudes seems set largely by age. Those old enough to recall GIs handing out chocolate bars to hungry youngsters say they regret the decline of the nation that brought them democracy.

"I know how generous Americans can be," said Radio Japan writer Toshi Morikawa. "When I first went to the U.S., in 1956, Japan was way behind, the pace of life was very slow and America was terribly efficient. That's what conditioned my thinking."

Younger Japanese take a considerably harsher view. They may wear Levis, munch on Big Macs, guzzle Coke and rock to Madonna; they may travel to the United States and observe Americans in movies and on CNN; they may openly long for a laid-back, freewheeling, independent lifestyle.

But they also find social disorder in the United States - crime, drug abuse, AIDS, illiteracy - frightening and menacing. Most see Japan, with its homogeneity, destined for leadership.

"Americans, especially white Americans, used to think they were the best," said Mitsuhiro Nakamura, a 21-year-old law student at Tokyo's Waseda University. "The Protestant work ethic gave them that feeling of superiority, and they looked down on other races, Africans and Asians. But they've lost that drive and now they have an economic inferiority complex as far as Japan is concerned."

Some Americans who have lived in Japan long enough to observe the transition of the economy express concern over where success may be leading Japan.

"Japanese confidence, and with it a sort of cultural smugness, have increased in direct parallel with Japan's economic successes," said Skip Cronin, a public relations consultant and San Francisco native who has lived in Tokyo for 28 years.

Mr. Cronin, who is bilingual, said he regularly overhears Japanese talking about how yushu, or superior, they feel toward other nationalities.

"Secretaries, businessmen, florists, merchants, students, I've heard this comment on many, many occasions," he said. "Toward Americans, there appears to be a sort of 'knowingness,' a sort of popularly held preconception that aside from their sense of humor and easygoing ways, there isn't much more to Americans."