TOKYO -- The Japanese public is happier about the economy than at any time in nearly two decades, though few think the next generation will have it as good. People's biggest fear is automation, not foreigners, taking jobs from local workers.

While 44% of respondents to a Pew Research Center survey said the current economic situation is good, 15% answered that today's children will be better off than their parents.

Nearly 90% think robots and computers will be doing much of the work currently done by humans in the next half century. Some 83% see this causing greater inequality, 74% believe people will have trouble finding work and 58% think automation will not generate better jobs.

Japan is the world's fourth most automated economy, after South Korea, Singapore and Germany, according to a 2018 report by the International Federation of Robotics. In 2016, the country had 303 industrial robots per 10,000 workers in the manufacturing industry.

Other nations share Japan's concerns about automation in the workplace. A separate Pew survey in the U.S. last year showed Americans are roughly twice as likely to express worry than enthusiasm about a future in which robots and computers are capable of doing many jobs currently done by humans.

While there are greater numbers of foreigners and women working in the country, Japan is using automation to make up for a shrinking labor force as the population grays and declines. The tight labor market is reflected in the country's jobs-to-applicants ratio, which hit a 44-year-high of 1.64 in September, as well as in the overall unemployment rate of 2.3%, close to the lowest level since 1992.

But there is some positive sentiment toward robots in the workplace. About 74% see automation making Japan's economy more efficient, and younger adults (aged 18-29) see it leading to new, higher-paying employment.

Japan's demographic decline has also pushed Prime Minister Shinzo Abe's government to come up with a plan to accept more foreign workers -- a dramatic shift in Japan's stance on immigration.

The plan, submitted to parliament earlier this month, creates two visa categories to cover overseas workers in 14 sectors facing the most severe labor shortages. Agriculture, nursing care and construction are among the sectors.

But some conservative members of Abe's ruling Liberal Democratic Party have attacked the bill, seeing it has potentially paving the way to permanent residency. Others have cited a possible increase in crime and the challenge of handling increased arrivals.

Asked by Pew about the number of immigrants, 23% of respondents said the government should allow more people to enter the country, 13% saying there should be fewer and 58% answered that the number should remain near the current level.

About three-quarters of the respondents said immigrants currently in Japan want to assimilate, and 59% believe foreign workers make Japan stronger. About one-third see those coming from overseas as a burden on society by taking jobs or relying on social benefits.

People were more split on whether foreigners are more to blame for crime than other groups -- 52% said they are no more at fault, with 40% saying they are more responsible.

The number of foreigners in Japan was about 2 million in 2015, according to Japan's statistical bureau, with 1.3 million Japanese living abroad.

The Pew survey shows that the public is more concerned about emigration than immigration. About six-in-ten said people leaving Japan for jobs in other countries is a problem, up from 39% in 2002.

Other survey findings include:

-- 48% of respondents have confidence in Abe to do the right thing in world affairs, down from 62% in 2015

-- 40% are satisfied with the way democracy is working in Japan, down from 50% last year.

-- 62% said they do not believe elections change anything.

-- 67% have a positive opinion about the U.S., but only three in ten have confidence in President Donald Trump.

-- 81% would chose the U.S. to be the world's leading power over China (8%).

-- 17% have a favorable opinion of China, up from 5% in 2013.

-- 65% chose German Chancellor Angela Merkel when asked who they are confident in to handle global affairs.

Pew surveyed 1,016 people in Japan between May 24 and June 19.