Rows of white-shirted boys are put through their paces as they are called up individually to complete a chemical formula by teacher Shen Huimin, who hopes that a switch to male-only classes will help them overcome their reticence.
"We give boys a chance to change," she said.
The Shanghai school system topped the Organisation for Economic Co-Operation and Development's (OECD) worldwide assessment tests of 15-year-olds in 2009, the most recent available, ahead of Korea, Finland, Hong Kong and Singapore.
But even so officials are concerned that some male students may be slower than their female counterparts in development and certain academic areas, such as language, and the shift towards single sex classes aims to boost boys' confidence.
A prominent Chinese educator, Sun Yunxiao, found the proportion of boys classed among the top scholars in the country's "gaokao" university entrance exams plunged from 66.2 percent to 39.7 percent between 1999 and 2008.
Across the developed world, girls do better than boys in secondary school, the OECD's Programme for International Student Assessment (PISA) found in a 2009 report on the educational performances of 15-year-olds.
"There are significant gender differences in educational outcomes," it said, adding that high school graduation rates across the OECD were 87 percent for girls but only 79 percent for boys.
In response, Shanghai's elite Number Eight High School is halfway through the initial year of an experiment, putting 60 boys into two classes of their own -- a quarter of its first-year students -- and teaching them with a special curriculum.
"This is a big breakthrough," said principal Lu Qisheng. "There's lots of hope -- hope that boys will grow up better.
"Boys when they are young do not spend enough time studying," he explained. "Boys' maturity, especially for language and showing self-control, lags behind girls."
China shut most same-sex schools after the Communist Party came to power in 1949, and the only all-boys junior high schools in the country are privately run.
Shanghai does have an all-girls state-run high school, the former McTyeire School for Girls, which marked its 120th anniversary last year and counts the three Soong sisters -- Qing-ling, Ai-ling and Mei-ling -- among its former pupils.
Between them they married two leaders and an industrialist. Qing-ling married Sun Yat-sen, the first President of the Republic of China, while Mei-ling wed Chiang Kai-shek, who would also later become president.
Student Li Zhongyang, 15, said he felt less shy about answering questions in his all-boys class, but drew hoots of laughter from his fellows by suggesting an absence of girls let them concentrate more on study.
"We lack confidence," he said. "The teachers like girls, who answer more questions in class. This programme lets us realise we are not worse than girls."
It is something of a contrast to males' traditionally dominant roles in Chinese culture, but principal Lu said the programme "doesn't have much relationship to equality in society".
The scheme was launched after China's government called for more "diversification" in educational choices within the state system.
A Peking University professor has called for an even bolder reform, suggesting in September that boys should start school one or two years later than girls.
"The Chinese education system needs to improve and allow various education methods," Wu Bihu said on his microblog.
Now Lu hopes to create China's first all-boys school one day.
"Ten or twenty years ago, there was no need for an all-boys class -- just put everyone together," he said.
In an increasingly aspirational society, he added, some families saw the new programme as having connotations of top overseas private schools, and so promising an advantage in the highly competitive gaokao.
"The parents know: England has Eton," he said.